]> git.sur5r.net Git - i3/i3/commitdiff
Merge branch 'master' into next
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 22 Apr 2012 18:11:25 +0000 (20:11 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 22 Apr 2012 18:11:25 +0000 (20:11 +0200)
i3bar/src/xcb.c

index a3f0dda8020e09f49b4a4442e2619dad77457e3e..53ea0d312d73497e1cf31974d6526be3bd26f28b 100644 (file)
@@ -1047,18 +1047,8 @@ 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);
@@ -1108,6 +1098,18 @@ void destroy_window(i3_output *output) {
     if (output->bar == XCB_NONE) {
         return;
     }
+
+    trayclient *trayclient;
+    TAILQ_FOREACH(trayclient, output->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);
+    }
+
     xcb_destroy_window(xcb_connection, output->bar);
     output->bar = XCB_NONE;
 }