X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=8c1adeb593b7267b4ee37363787517e16c633af8;hp=780f1fb9d27463e3d36c798c275d6b4d0ccf59b1;hb=3a392b855882786d1aa9c842d1c36b5c1cbc576a;hpb=8a111c181ea7c14fa3903bebccd3e1cc00e1fe31 diff --git a/dwm.c b/dwm.c index 780f1fb..8c1adeb 100644 --- a/dwm.c +++ b/dwm.c @@ -42,7 +42,7 @@ /* macros */ #define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) -#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask)) +#define CLEANMASK(mask) (mask & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) #define INRECT(X,Y,RX,RY,RW,RH) ((X) >= (RX) && (X) < (RX) + (RW) && (Y) >= (RY) && (Y) < (RY) + (RH)) #define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) #define LENGTH(X) (sizeof X / sizeof X[0]) @@ -585,11 +585,13 @@ void configurenotify(XEvent *e) { Monitor *m; XConfigureEvent *ev = &e->xconfigure; + Bool dirty; if(ev->window == root) { + dirty = (sw != ev->width); sw = ev->width; sh = ev->height; - if(updategeom()) { + if(updategeom() || dirty) { if(dc.drawable != 0) XFreePixmap(dpy, dc.drawable); dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen)); @@ -818,15 +820,19 @@ drawtext(const char *text, unsigned long col[ColLast], Bool invert) { void enternotify(XEvent *e) { + Client *c; Monitor *m; XCrossingEvent *ev = &e->xcrossing; if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root) return; + c = wintoclient(ev->window); if((m = wintomon(ev->window)) && m != selmon) { unfocus(selmon->sel, True); selmon = m; } + else if(c == selmon->sel || c == NULL) + return; focus((wintoclient(ev->window))); } @@ -2034,7 +2040,6 @@ zoom(const Arg *arg) { Client *c = selmon->sel; if(!selmon->lt[selmon->sellt]->arrange - || selmon->lt[selmon->sellt]->arrange == monocle || (selmon->sel && selmon->sel->isfloating)) return; if(c == nexttiled(selmon->clients)) @@ -2046,7 +2051,7 @@ zoom(const Arg *arg) { int main(int argc, char *argv[]) { if(argc == 2 && !strcmp("-v", argv[1])) - die("dwm-"VERSION", © 2006-2010 dwm engineers, see LICENSE for details\n"); + die("dwm-"VERSION", © 2006-2011 dwm engineers, see LICENSE for details\n"); else if(argc != 1) die("usage: dwm [-v]\n"); if(!setlocale(LC_CTYPE, "") || !XSupportsLocale())