added an creatnotify event handler

This commit is contained in:
Anselm R. Garbe
2007-06-04 11:50:48 +02:00
parent 5a1a2edf0e
commit 83aa110c6f
4 changed files with 56 additions and 40 deletions

14
event.c
View File

@ -224,6 +224,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;
@ -350,6 +363,7 @@ void (*handler[LASTEvent]) (XEvent *) = {
[ButtonPress] = buttonpress,
[ConfigureRequest] = configurerequest,
[ConfigureNotify] = configurenotify,
[CreateNotify] = createnotify,
[DestroyNotify] = destroynotify,
[EnterNotify] = enternotify,
[LeaveNotify] = leavenotify,