event.c
changeset 915 67104d329f06
parent 910 c13cb8c6b7a5
child 916 b0dfa4fe6c63
--- a/event.c	Mon Jun 04 11:37:33 2007 +0200
+++ b/event.c	Mon Jun 04 11:50:48 2007 +0200
@@ -225,6 +225,19 @@
 }
 
 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 @@
 	[ButtonPress] = buttonpress,
 	[ConfigureRequest] = configurerequest,
 	[ConfigureNotify] = configurenotify,
+	[CreateNotify] = createnotify,
 	[DestroyNotify] = destroynotify,
 	[EnterNotify] = enternotify,
 	[LeaveNotify] = leavenotify,