]> git.sur5r.net Git - i3/i3/commitdiff
i3bar: properly end the XEMBED protocol by reparenting the dock clients to root,...
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 16 Aug 2011 23:19:38 +0000 (01:19 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 23 Aug 2011 23:18:27 +0000 (01:18 +0200)
i3bar/src/xcb.c

index e35c435574c69e6406bf964965cfaa9730341b88..00d25272ebf173c1e703cd695890a9083b0acf2d 100644 (file)
@@ -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);