]> git.sur5r.net Git - i3/i3/commitdiff
i3bar: put tray icons in the save-set (prevents them from crashing when i3bar exits...
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 24 Oct 2011 19:11:32 +0000 (20:11 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 24 Oct 2011 19:11:32 +0000 (20:11 +0100)
i3bar/src/ipc.c
i3bar/src/xcb.c

index 009c276f32b8e80bafe60e4a53c7960a867d7619..c704b4f9fde0eb037672cbed1179264c4f08e4fe 100644 (file)
@@ -165,6 +165,7 @@ void got_data(struct ev_loop *loop, ev_io *watcher, int events) {
             /* EOF received. Since i3 will restart i3bar instances as appropriate,
              * we exit here. */
             DLOG("EOF received, exiting...\n");
+            clean_xcb();
             exit(EXIT_SUCCESS);
         }
         rec += n;
index 01caeeea83fb1769097b5fbc16a84a4668b12cdc..bb7e5c77c0feb3eb6a4e990d74ae2e3709c20374 100644 (file)
@@ -499,6 +499,13 @@ static void handle_client_message(xcb_client_message_event_t* event) {
                            (char*)ev);
             free(event);
 
+            /* Put the client inside the save set. Upon termination (whether
+             * killed or normal exit does not matter) of i3bar, these clients
+             * will be correctly reparented to their most closest living
+             * ancestor. Without this, tray icons might die when i3bar
+             * exits/crashes. */
+            xcb_change_save_set(xcb_connection, XCB_SET_MODE_INSERT, client);
+
             if (map_it) {
                 DLOG("Mapping dock client\n");
                 xcb_map_window(xcb_connection, client);