some minor changes

This commit is contained in:
Anselm R Garbe 2009-07-08 17:05:20 +01:00
parent 61c3095f2f
commit 6620615ab9

22
dwm.c
View file

@ -177,7 +177,7 @@ static void focusin(XEvent *e);
static void focusmon(const Arg *arg); static void focusmon(const Arg *arg);
static void focusstack(const Arg *arg); static void focusstack(const Arg *arg);
static unsigned long getcolor(const char *colstr); static unsigned long getcolor(const char *colstr);
static Bool getrootpointer(int *x, int *y); static Bool getrootptr(int *x, int *y);
static long getstate(Window w); static long getstate(Window w);
static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
static void grabbuttons(Client *c, Bool focused); static void grabbuttons(Client *c, Bool focused);
@ -192,7 +192,7 @@ static void maprequest(XEvent *e);
static void monocle(Monitor *m); static void monocle(Monitor *m);
static void movemouse(const Arg *arg); static void movemouse(const Arg *arg);
static Client *nexttiled(Client *c); static Client *nexttiled(Client *c);
static Monitor *pointertomon(int x, int y); static Monitor *ptrtomon(int x, int y);
static void propertynotify(XEvent *e); static void propertynotify(XEvent *e);
static void quit(const Arg *arg); static void quit(const Arg *arg);
static void resize(Client *c, int x, int y, int w, int h, Bool interact); static void resize(Client *c, int x, int y, int w, int h, Bool interact);
@ -862,7 +862,7 @@ getcolor(const char *colstr) {
} }
Bool Bool
getrootpointer(int *x, int *y) { getrootptr(int *x, int *y) {
int di; int di;
unsigned int dui; unsigned int dui;
Window dummy; Window dummy;
@ -1147,7 +1147,7 @@ movemouse(const Arg *arg) {
if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
None, cursor[CurMove], CurrentTime) != GrabSuccess) None, cursor[CurMove], CurrentTime) != GrabSuccess)
return; return;
if(!getrootpointer(&x, &y)) if(!getrootptr(&x, &y))
return; return;
do { do {
XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
@ -1181,7 +1181,7 @@ movemouse(const Arg *arg) {
} }
while(ev.type != ButtonRelease); while(ev.type != ButtonRelease);
XUngrabPointer(dpy, CurrentTime); XUngrabPointer(dpy, CurrentTime);
if((m = pointertomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) { if((m = ptrtomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) {
sendmon(c, m); sendmon(c, m);
selmon = m; selmon = m;
focus(NULL); focus(NULL);
@ -1195,7 +1195,7 @@ nexttiled(Client *c) {
} }
Monitor * Monitor *
pointertomon(int x, int y) { ptrtomon(int x, int y) {
Monitor *m; Monitor *m;
for(m = mons; m; m = m->next) for(m = mons; m; m = m->next)
@ -1302,7 +1302,7 @@ resizemouse(const Arg *arg) {
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
XUngrabPointer(dpy, CurrentTime); XUngrabPointer(dpy, CurrentTime);
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
if((m = pointertomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) { if((m = ptrtomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) {
sendmon(c, m); sendmon(c, m);
selmon = m; selmon = m;
focus(NULL); focus(NULL);
@ -1329,6 +1329,7 @@ restack(Monitor *m) {
wc.sibling = c->win; wc.sibling = c->win;
} }
} }
XLowerWindow(dpy, m->barwin);
XSync(dpy, False); XSync(dpy, False);
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
} }
@ -1339,11 +1340,10 @@ run(void) {
/* main event loop */ /* main event loop */
XSync(dpy, False); XSync(dpy, False);
while(running && !XNextEvent(dpy, &ev)) { while(running && !XNextEvent(dpy, &ev))
if(handler[ev.type]) if(handler[ev.type])
(handler[ev.type])(&ev); /* call handler */ (handler[ev.type])(&ev); /* call handler */
} }
}
void void
scan(void) { scan(void) {
@ -1870,8 +1870,8 @@ wintomon(Window w) {
Client *c; Client *c;
Monitor *m; Monitor *m;
if(w == root && getrootpointer(&x, &y)) if(w == root && getrootptr(&x, &y))
return pointertomon(x, y); return ptrtomon(x, y);
for(m = mons; m; m = m->next) for(m = mons; m; m = m->next)
if(w == m->barwin) if(w == m->barwin)
return m; return m;