some minor changes
6620615a
1 file(s) · +11 −11
| 177 | 177 | static void focusmon(const Arg *arg); |
|
| 178 | 178 | static void focusstack(const Arg *arg); |
|
| 179 | 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 | 181 | static long getstate(Window w); |
|
| 182 | 182 | static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); |
|
| 183 | 183 | static void grabbuttons(Client *c, Bool focused); |
|
| 192 | 192 | static void monocle(Monitor *m); |
|
| 193 | 193 | static void movemouse(const Arg *arg); |
|
| 194 | 194 | static Client *nexttiled(Client *c); |
|
| 195 | - | static Monitor *pointertomon(int x, int y); |
|
| 195 | + | static Monitor *ptrtomon(int x, int y); |
|
| 196 | 196 | static void propertynotify(XEvent *e); |
|
| 197 | 197 | static void quit(const Arg *arg); |
|
| 198 | 198 | static void resize(Client *c, int x, int y, int w, int h, Bool interact); |
|
| 862 | 862 | } |
|
| 863 | 863 | ||
| 864 | 864 | Bool |
|
| 865 | - | getrootpointer(int *x, int *y) { |
|
| 865 | + | getrootptr(int *x, int *y) { |
|
| 866 | 866 | int di; |
|
| 867 | 867 | unsigned int dui; |
|
| 868 | 868 | Window dummy; |
|
| 1147 | 1147 | if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, |
|
| 1148 | 1148 | None, cursor[CurMove], CurrentTime) != GrabSuccess) |
|
| 1149 | 1149 | return; |
|
| 1150 | - | if(!getrootpointer(&x, &y)) |
|
| 1150 | + | if(!getrootptr(&x, &y)) |
|
| 1151 | 1151 | return; |
|
| 1152 | 1152 | do { |
|
| 1153 | 1153 | XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); |
|
| 1181 | 1181 | } |
|
| 1182 | 1182 | while(ev.type != ButtonRelease); |
|
| 1183 | 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 | 1185 | sendmon(c, m); |
|
| 1186 | 1186 | selmon = m; |
|
| 1187 | 1187 | focus(NULL); |
|
| 1195 | 1195 | } |
|
| 1196 | 1196 | ||
| 1197 | 1197 | Monitor * |
|
| 1198 | - | pointertomon(int x, int y) { |
|
| 1198 | + | ptrtomon(int x, int y) { |
|
| 1199 | 1199 | Monitor *m; |
|
| 1200 | 1200 | ||
| 1201 | 1201 | for(m = mons; m; m = m->next) |
|
| 1302 | 1302 | XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); |
|
| 1303 | 1303 | XUngrabPointer(dpy, CurrentTime); |
|
| 1304 | 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 | 1306 | sendmon(c, m); |
|
| 1307 | 1307 | selmon = m; |
|
| 1308 | 1308 | focus(NULL); |
|
| 1329 | 1329 | wc.sibling = c->win; |
|
| 1330 | 1330 | } |
|
| 1331 | 1331 | } |
|
| 1332 | + | XLowerWindow(dpy, m->barwin); |
|
| 1332 | 1333 | XSync(dpy, False); |
|
| 1333 | 1334 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); |
|
| 1334 | 1335 | } |
|
| 1339 | 1340 | ||
| 1340 | 1341 | /* main event loop */ |
|
| 1341 | 1342 | XSync(dpy, False); |
|
| 1342 | - | while(running && !XNextEvent(dpy, &ev)) { |
|
| 1343 | + | while(running && !XNextEvent(dpy, &ev)) |
|
| 1343 | 1344 | if(handler[ev.type]) |
|
| 1344 | 1345 | (handler[ev.type])(&ev); /* call handler */ |
|
| 1345 | - | } |
|
| 1346 | 1346 | } |
|
| 1347 | 1347 | ||
| 1348 | 1348 | void |
|
| 1870 | 1870 | Client *c; |
|
| 1871 | 1871 | Monitor *m; |
|
| 1872 | 1872 | ||
| 1873 | - | if(w == root && getrootpointer(&x, &y)) |
|
| 1874 | - | return pointertomon(x, y); |
|
| 1873 | + | if(w == root && getrootptr(&x, &y)) |
|
| 1874 | + | return ptrtomon(x, y); |
|
| 1875 | 1875 | for(m = mons; m; m = m->next) |
|
| 1876 | 1876 | if(w == m->barwin) |
|
| 1877 | 1877 | return m; |
|