From 83aa110c6fabbf5f5a14b698a6ca22072cb80629 Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Mon, 4 Jun 2007 11:50:48 +0200 Subject: added an creatnotify event handler --- event.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'event.c') diff --git a/event.c b/event.c index ad4e271..949812f 100644 --- a/event.c +++ b/event.c @@ -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, -- cgit v1.2.3