Fix restart and unmanaging windows in composite
authorDana Jansens <danakj@orodu.net>
Fri, 25 Jun 2010 16:42:12 +0000 (18:42 +0200)
committerDana Jansens <danakj@orodu.net>
Sat, 26 Jun 2010 23:30:51 +0000 (01:30 +0200)
When restarting, catch unmapped windows as ObUnmanaged objects
When unmanaging a client, ignore the ReparentNotify to root, rather than
 thinking the unmanaged window is now embedded somewhere
Also add some ob_debug's for unmanaged event handling

openbox/event.c
openbox/window.c

index a8a0b50..01653b0 100644 (file)
@@ -1848,15 +1848,21 @@ static void event_handle_unmanaged(ObUnmanaged *um, XEvent *e)
             unmanaged_update_opacity(um);
         break;
     case DestroyNotify:
+        ob_debug("DestroyNotify for unmanaged 0x%lx", window_top(um));
         unmanaged_destroy(um);
         break;
     case MapRequest:
+        ob_debug("MapRequest for unmanaged 0x%lx", window_top(um));
         w = window_top(um);
         unmanaged_destroy(um);
         window_manage(w);
         break;
     case ReparentNotify:
-        unmanaged_destroy(um);
+        /* when we unmanage something it causes a reparent notify also */
+        if (e->xreparent.parent != obt_root(ob_screen)) {
+            ob_debug("ReparentNotify for unmanaged 0x%lx", window_top(um));
+            unmanaged_destroy(um);
+        }
         break;
     case ConfigureRequest:
         xwc.x = e->xconfigurerequest.x;
index a0b9ceb..db82e3f 100644 (file)
@@ -223,7 +223,7 @@ void window_manage_all(void)
         if (window_find(children[i])) continue; /* skip our own windows */
         if (XGetWindowAttributes(obt_display, children[i], &attrib)) {
             if (attrib.map_state == IsUnmapped)
-                ;
+                unmanaged_new(children[i]);
             else
                 window_manage(children[i]);
         }