From: Dana Jansens Date: Thu, 26 Jul 2007 00:49:50 +0000 (-0400) Subject: change the root event mask to add SubstructureNotifyMask, so we can hear about Overri... X-Git-Tag: composite^0 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=refs%2Fremotes%2Fgithub%2Fcomposite;p=dana%2Fopenbox.git change the root event mask to add SubstructureNotifyMask, so we can hear about Override-redirect windows --- diff --git a/openbox/event.c b/openbox/event.c index d2febd7e..b84dd63f 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1180,14 +1180,17 @@ static void event_handle_client(ObClient *client, XEvent *e) break; } case UnmapNotify: - if (client->ignore_unmaps) { - client->ignore_unmaps--; - break; - } + /* Don't care about the frame window unmapping */ + if (e->xunmap.window != client->window) break; + ob_debug("UnmapNotify for window 0x%x eventwin 0x%x sendevent %d " "ignores left %d\n", client->window, e->xunmap.event, e->xunmap.from_configure, client->ignore_unmaps); + if (client->ignore_unmaps) { + client->ignore_unmaps--; + break; + } client_unmanage(client); break; case DestroyNotify: diff --git a/openbox/frame.c b/openbox/frame.c index 9fb7b2b8..f1201f5a 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -936,9 +936,13 @@ void frame_grab_client(ObFrame *self) this occurs from a MapRequest. However, in the case where Openbox is starting up, the window is already mapped, so we'll see an unmap event for it. + + We also have to ignore a second UnmapNotify because we have + selected for SubstructureNotify on root. For whatever good reason, this + means we get 2 UnmapNotify events. */ if (ob_state() == OB_STATE_STARTING) - ++self->client->ignore_unmaps; + self->client->ignore_unmaps += 2; /* select the event mask on the client's parent (to receive config/map req's) the ButtonPress is to catch clicks on the client border */ diff --git a/openbox/screen.c b/openbox/screen.c index 8be41a47..cb704ac9 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -49,7 +49,8 @@ #define ROOT_EVENTMASK (StructureNotifyMask | PropertyChangeMask | \ EnterWindowMask | LeaveWindowMask | \ SubstructureRedirectMask | FocusChangeMask | \ - ButtonPressMask | ButtonReleaseMask) + ButtonPressMask | ButtonReleaseMask | \ + SubstructureNotifyMask) static gboolean screen_validate_layout(ObDesktopLayout *l); static gboolean replace_wm();