change the root event mask to add SubstructureNotifyMask, so we can hear about Overri...
authorDana Jansens <danakj@orodu.net>
Thu, 26 Jul 2007 00:49:50 +0000 (20:49 -0400)
committerDana Jansens <danakj@orodu.net>
Sat, 26 Jun 2010 23:30:46 +0000 (01:30 +0200)
openbox/event.c
openbox/frame.c
openbox/screen.c

index eb69d090827b0e524c2cf4ebc8593a4a3a292f12..46e569bfbfccd23a815da59c81e2be02d7d3590b 100644 (file)
@@ -1340,10 +1340,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;
index 389898c6b2d17677f94023076db8b041d14544af..5313fdfc2f62e1d76ee1f47e48b3d9e486c94a52 100644 (file)
@@ -517,9 +517,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 */
index e3ad861205b721be00a7609d13a5e4b14af2950a..56a7551ff595b4a57d7a744c89afa7e92a9efbb9 100644 (file)
@@ -50,7 +50,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);