KEYS
-#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
+#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
#define MOUSEMASK (BUTTONMASK | PointerMotionMask)
static Client *
return;
}
}
- if(ev->x < x + blw)
- switch(ev->button) {
- case Button1:
- setlayout(NULL);
- break;
- }
+ if((ev->x < x + blw) && ev->button == Button1)
+ setlayout(NULL);
}
else if((c = getclient(ev->window))) {
focus(c);
}
}
-static void
-createnotify(XEvent *e) {
- static XWindowAttributes wa;
- XCreateWindowEvent *ev = &e->xcreatewindow;
-
- if(!XGetWindowAttributes(dpy, ev->window, &wa))
- return;
- if(wa.override_redirect)
- return;
- if(!getclient(ev->window) && (wa.map_state == IsViewable))
- manage(ev->window, &wa);
-}
-
static void
destroynotify(XEvent *e) {
Client *c;
Client *c;
XUnmapEvent *ev = &e->xunmap;
- if((c = getclient(ev->window)))
- unmanage(c);
+ if((c = getclient(ev->window)) && (ev->event == root)) {
+ if(ev->send_event || c->unmapped-- == 0)
+ unmanage(c);
+ }
}
/* extern */
[ButtonPress] = buttonpress,
[ConfigureRequest] = configurerequest,
[ConfigureNotify] = configurenotify,
- [CreateNotify] = createnotify,
[DestroyNotify] = destroynotify,
[EnterNotify] = enternotify,
[LeaveNotify] = leavenotify,