From 1c2c22d11756ad7eeae0a628f0bfb2ef749c9bea Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 17 Aug 2011 01:19:38 +0200 Subject: [PATCH] i3bar: properly end the XEMBED protocol by reparenting the dock clients to root, flush connection before disconnecting --- i3bar/src/xcb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index e35c4355..00d25272 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -990,15 +990,27 @@ void init_tray() { */ void clean_xcb() { i3_output *o_walk; + trayclient *trayclient; free_workspaces(); SLIST_FOREACH(o_walk, outputs, slist) { + TAILQ_FOREACH(trayclient, o_walk->trayclients, tailq) { + /* Unmap, then reparent (to root) the tray client windows */ + xcb_unmap_window(xcb_connection, trayclient->win); + xcb_reparent_window(xcb_connection, + trayclient->win, + xcb_root, + 0, + 0); + } destroy_window(o_walk); + FREE(o_walk->trayclients); FREE(o_walk->workspaces); FREE(o_walk->name); } FREE_SLIST(outputs, i3_output); FREE(outputs); + xcb_flush(xcb_connection); xcb_disconnect(xcb_connection); ev_check_stop(main_loop, xcb_chk); -- 2.39.5