change the root event mask to add SubstructureNotifyMask, so we can hear about Overri... github/composite origin/composite composite
authorDana Jansens <danakj@orodu.net>
Thu, 26 Jul 2007 00:49:50 +0000 (20:49 -0400)
committerDana Jansens <danakj@orodu.net>
Thu, 26 Jul 2007 13:57:29 +0000 (09:57 -0400)
openbox/event.c
openbox/frame.c
openbox/screen.c

index d2febd7e4349cfef206c6660980667dedb605086..b84dd63fb26a35d842ce84107b9aac0d5b4760c5 100644 (file)
@@ -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:
index 9fb7b2b8a48de0f9e963fc45d6f43cd8540b3f3f..f1201f5afb2774db885c282cc31e560a80085254 100644 (file)
@@ -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 */
index 8be41a476f5c492c082b72a7d54bc57a08f6923b..cb704ac98859b867a445c135c30ecaf0f5a5159b 100644 (file)
@@ -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();