diff options
| author | Anselm R Garbe <garbeam@gmail.com> | 2009-07-08 17:05:20 +0100 |
|---|---|---|
| committer | Anselm R Garbe <garbeam@gmail.com> | 2009-07-08 17:05:20 +0100 |
| commit | 6620615ab9a37fee21e2b381d069c89a72a580c2 (patch) | |
| tree | 9af5a1846e291aeb347c9a05191b9982bc71504c /dwm.c | |
| parent | die if malloc sizeof(Monitor) fails (diff) | |
| download | dwm-6620615ab9a37fee21e2b381d069c89a72a580c2.tar.gz dwm-6620615ab9a37fee21e2b381d069c89a72a580c2.zip | |
some minor changes
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 22 |
1 files changed, 11 insertions, 11 deletions
| @@ -177,7 +177,7 @@ static void focusin(XEvent *e); | |||
| 177 | static void focusmon(const Arg *arg); | 177 | static void focusmon(const Arg *arg); |
| 178 | static void focusstack(const Arg *arg); | 178 | static void focusstack(const Arg *arg); |
| 179 | static unsigned long getcolor(const char *colstr); | 179 | static unsigned long getcolor(const char *colstr); |
| 180 | static Bool getrootpointer(int *x, int *y); | 180 | static Bool getrootptr(int *x, int *y); |
| 181 | static long getstate(Window w); | 181 | static long getstate(Window w); |
| 182 | static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); | 182 | static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); |
| 183 | static void grabbuttons(Client *c, Bool focused); | 183 | static void grabbuttons(Client *c, Bool focused); |
| @@ -192,7 +192,7 @@ static void maprequest(XEvent *e); | |||
| 192 | static void monocle(Monitor *m); | 192 | static void monocle(Monitor *m); |
| 193 | static void movemouse(const Arg *arg); | 193 | static void movemouse(const Arg *arg); |
| 194 | static Client *nexttiled(Client *c); | 194 | static Client *nexttiled(Client *c); |
| 195 | static Monitor *pointertomon(int x, int y); | 195 | static Monitor *ptrtomon(int x, int y); |
| 196 | static void propertynotify(XEvent *e); | 196 | static void propertynotify(XEvent *e); |
| 197 | static void quit(const Arg *arg); | 197 | static void quit(const Arg *arg); |
| 198 | static void resize(Client *c, int x, int y, int w, int h, Bool interact); | 198 | static void resize(Client *c, int x, int y, int w, int h, Bool interact); |
| @@ -862,7 +862,7 @@ getcolor(const char *colstr) { | |||
| 862 | } | 862 | } |
| 863 | 863 | ||
| 864 | Bool | 864 | Bool |
| 865 | getrootpointer(int *x, int *y) { | 865 | getrootptr(int *x, int *y) { |
| 866 | int di; | 866 | int di; |
| 867 | unsigned int dui; | 867 | unsigned int dui; |
| 868 | Window dummy; | 868 | Window dummy; |
| @@ -1147,7 +1147,7 @@ movemouse(const Arg *arg) { | |||
| 1147 | if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, | 1147 | if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, |
| 1148 | None, cursor[CurMove], CurrentTime) != GrabSuccess) | 1148 | None, cursor[CurMove], CurrentTime) != GrabSuccess) |
| 1149 | return; | 1149 | return; |
| 1150 | if(!getrootpointer(&x, &y)) | 1150 | if(!getrootptr(&x, &y)) |
| 1151 | return; | 1151 | return; |
| 1152 | do { | 1152 | do { |
| 1153 | XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); | 1153 | XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); |
| @@ -1181,7 +1181,7 @@ movemouse(const Arg *arg) { | |||
| 1181 | } | 1181 | } |
| 1182 | while(ev.type != ButtonRelease); | 1182 | while(ev.type != ButtonRelease); |
| 1183 | XUngrabPointer(dpy, CurrentTime); | 1183 | XUngrabPointer(dpy, CurrentTime); |
| 1184 | if((m = pointertomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) { | 1184 | if((m = ptrtomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) { |
| 1185 | sendmon(c, m); | 1185 | sendmon(c, m); |
| 1186 | selmon = m; | 1186 | selmon = m; |
| 1187 | focus(NULL); | 1187 | focus(NULL); |
| @@ -1195,7 +1195,7 @@ nexttiled(Client *c) { | |||
| 1195 | } | 1195 | } |
| 1196 | 1196 | ||
| 1197 | Monitor * | 1197 | Monitor * |
| 1198 | pointertomon(int x, int y) { | 1198 | ptrtomon(int x, int y) { |
| 1199 | Monitor *m; | 1199 | Monitor *m; |
| 1200 | 1200 | ||
| 1201 | for(m = mons; m; m = m->next) | 1201 | for(m = mons; m; m = m->next) |
| @@ -1302,7 +1302,7 @@ resizemouse(const Arg *arg) { | |||
| 1302 | XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); | 1302 | XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); |
| 1303 | XUngrabPointer(dpy, CurrentTime); | 1303 | XUngrabPointer(dpy, CurrentTime); |
| 1304 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); | 1304 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); |
| 1305 | if((m = pointertomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) { | 1305 | if((m = ptrtomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) { |
| 1306 | sendmon(c, m); | 1306 | sendmon(c, m); |
| 1307 | selmon = m; | 1307 | selmon = m; |
| 1308 | focus(NULL); | 1308 | focus(NULL); |
| @@ -1329,6 +1329,7 @@ restack(Monitor *m) { | |||
| 1329 | wc.sibling = c->win; | 1329 | wc.sibling = c->win; |
| 1330 | } | 1330 | } |
| 1331 | } | 1331 | } |
| 1332 | XLowerWindow(dpy, m->barwin); | ||
| 1332 | XSync(dpy, False); | 1333 | XSync(dpy, False); |
| 1333 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); | 1334 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); |
| 1334 | } | 1335 | } |
| @@ -1339,10 +1340,9 @@ run(void) { | |||
| 1339 | 1340 | ||
| 1340 | /* main event loop */ | 1341 | /* main event loop */ |
| 1341 | XSync(dpy, False); | 1342 | XSync(dpy, False); |
| 1342 | while(running && !XNextEvent(dpy, &ev)) { | 1343 | while(running && !XNextEvent(dpy, &ev)) |
| 1343 | if(handler[ev.type]) | 1344 | if(handler[ev.type]) |
| 1344 | (handler[ev.type])(&ev); /* call handler */ | 1345 | (handler[ev.type])(&ev); /* call handler */ |
| 1345 | } | ||
| 1346 | } | 1346 | } |
| 1347 | 1347 | ||
| 1348 | void | 1348 | void |
| @@ -1870,8 +1870,8 @@ wintomon(Window w) { | |||
| 1870 | Client *c; | 1870 | Client *c; |
| 1871 | Monitor *m; | 1871 | Monitor *m; |
| 1872 | 1872 | ||
| 1873 | if(w == root && getrootpointer(&x, &y)) | 1873 | if(w == root && getrootptr(&x, &y)) |
| 1874 | return pointertomon(x, y); | 1874 | return ptrtomon(x, y); |
| 1875 | for(m = mons; m; m = m->next) | 1875 | for(m = mons; m; m = m->next) |
| 1876 | if(w == m->barwin) | 1876 | if(w == m->barwin) |
| 1877 | return m; | 1877 | return m; |
