From 5536d8e78b3c0d806675147aba5052a0dcd3c0ae Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 30 Jan 2009 16:13:34 +0100 Subject: [PATCH] wibox: reparent systray only if needed (FS#436) Signed-off-by: Julien Danjou --- wibox.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/wibox.c b/wibox.c index 3f77ca4e2..a2bb5347f 100644 --- a/wibox.c +++ b/wibox.c @@ -109,14 +109,17 @@ wibox_systray_kickout(int phys_screen) { xcb_screen_t *s = xutil_screen_get(globalconf.connection, phys_screen); - /* Who! Check that we're not deleting a wibox with a systray, because it - * may be its parent. If so, we reparent to root before, otherwise it will - * hurt very much. */ - xcb_reparent_window(globalconf.connection, - globalconf.screens[phys_screen].systray.window, - s->root, -512, -512); + if(globalconf.screens[phys_screen].systray.parent != s->root) + { + /* Who! Check that we're not deleting a wibox with a systray, because it + * may be its parent. If so, we reparent to root before, otherwise it will + * hurt very much. */ + xcb_reparent_window(globalconf.connection, + globalconf.screens[phys_screen].systray.window, + s->root, -512, -512); - globalconf.screens[phys_screen].systray.parent = s->root; + globalconf.screens[phys_screen].systray.parent = s->root; + } } static void