From a55fd6d7846de61cdc990c64740067d8d9dc1faf Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 25 Jun 2010 18:11:27 +0200 Subject: [PATCH] handle windows that get embedded such as systray stuff. stop redirecting and watching them when they are reparented away from root and vice versa --- openbox/event.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/openbox/event.c b/openbox/event.c index 9033972a..a8a0b50e 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -203,6 +203,9 @@ static Window event_get_window(XEvent *e) case DestroyNotify: window = e->xdestroywindow.window; break; + case ReparentNotify: + window = e->xreparent.window; + break; case ConfigureRequest: window = e->xconfigurerequest.window; break; @@ -636,11 +639,15 @@ static void event_process(const XEvent *ec, gpointer data) if (client && client != focus_client) frame_adjust_focus(client->frame, FALSE); } - else if (e->type == CreateNotify) { - XCreateWindowEvent const *xe = &e->xcreatewindow; - - if (!obwin && xe->parent == obt_root(ob_screen)) - obwin = UNMANAGED_AS_WINDOW(unmanaged_new(xe->window)); + else if (e->type == CreateNotify && + !obwin && e->xcreatewindow.parent == obt_root(ob_screen)) + { + obwin = UNMANAGED_AS_WINDOW(unmanaged_new(e->xcreatewindow.window)); + } + else if (e->type == ReparentNotify && + !obwin && e->xreparent.parent == obt_root(ob_screen)) + { + obwin = UNMANAGED_AS_WINDOW(unmanaged_new(e->xreparent.window)); } else if (obwin && event_handle_window(obwin, e)) /* handled it ! */; @@ -1848,6 +1855,9 @@ static void event_handle_unmanaged(ObUnmanaged *um, XEvent *e) unmanaged_destroy(um); window_manage(w); break; + case ReparentNotify: + unmanaged_destroy(um); + break; case ConfigureRequest: xwc.x = e->xconfigurerequest.x; xwc.y = e->xconfigurerequest.y; -- 2.34.1