From 00af464f93eb7e9371851a38e8bb323d84afed03 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 25 Jul 2007 20:49:50 -0400 Subject: [PATCH] change the root event mask to add SubstructureNotifyMask, so we can hear about Override-redirect windows --- openbox/event.c | 5 +++++ openbox/frame.c | 6 +++++- openbox/screen.c | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/openbox/event.c b/openbox/event.c index bce1de12..376eb0dd 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1234,10 +1234,15 @@ static void event_handle_client(ObClient *client, XEvent *e) break; } case UnmapNotify: + /* 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", client->window, e->xunmap.event, e->xunmap.from_configure, client->ignore_unmaps); + */ if (client->ignore_unmaps) { client->ignore_unmaps--; break; diff --git a/openbox/frame.c b/openbox/frame.c index 0975214c..f392913a 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -972,9 +972,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 fcd0de8c..fd0dadfc 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -48,7 +48,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(void); -- 2.34.1