diff options
author | Anselm R. Garbe <arg@suckless.org> | 2007-06-04 11:50:48 +0200 |
---|---|---|
committer | Anselm R. Garbe <arg@suckless.org> | 2007-06-04 11:50:48 +0200 |
commit | 83aa110c6fabbf5f5a14b698a6ca22072cb80629 (patch) | |
tree | c79a56f48a11a72a551cf3a9a628362579d11095 /event.c | |
parent | 5a1a2edf0e584e660e16d2e01094851e0f9161e2 (diff) | |
download | dwm-83aa110c6fabbf5f5a14b698a6ca22072cb80629.tar.gz |
added an creatnotify event handler
Diffstat (limited to 'event.c')
-rw-r--r-- | event.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -225,6 +225,19 @@ configurenotify(XEvent *e) { } 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; XDestroyWindowEvent *ev = &e->xdestroywindow; @@ -350,6 +363,7 @@ void (*handler[LASTEvent]) (XEvent *) = { [ButtonPress] = buttonpress, [ConfigureRequest] = configurerequest, [ConfigureNotify] = configurenotify, + [CreateNotify] = createnotify, [DestroyNotify] = destroynotify, [EnterNotify] = enternotify, [LeaveNotify] = leavenotify, |