i3bar: put tray icons in the save-set (prevents them from crashing when i3bar exits/crashes)

This commit is contained in:
Michael Stapelberg 2011-10-24 20:11:32 +01:00
parent d490bae8a2
commit 35bd2d27c0
2 changed files with 8 additions and 0 deletions

View 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;

View 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);