From aa08a615ff13e070c44c73395acf97e7e501ac97 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 25 Jun 2010 18:42:12 +0200 Subject: [PATCH] Fix restart and unmanaging windows in composite 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 | 8 +++++++- openbox/window.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/openbox/event.c b/openbox/event.c index a8a0b50e..01653b0d 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -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; diff --git a/openbox/window.c b/openbox/window.c index a0b9cebf..db82e3f2 100644 --- a/openbox/window.c +++ b/openbox/window.c @@ -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]); } -- 2.34.1