From dcf2f03881d50683312f0cb994afecac5b6a57b6 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 14 Jul 2010 17:26:55 +0200 Subject: [PATCH] Add systray windows to the save-set When an X11 client disconnects from the X server, all of its windows are destroyed. This also means that all the sub-windows of those windows are destroyed which is not necessary what one wants to happen. To work around this, X11 has a "save-set". All the windows that are in the save-set are reparented to their closest ancestor when they would normally be destroyed. This is just what this code needs. :) (The windows in the save-set are also mapped when they are saved, dunno if this hurts here or not) Signed-off-by: Uli Schlachter --- systray.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/systray.c b/systray.c index 576c99da4..cbdb0e868 100644 --- a/systray.c +++ b/systray.c @@ -155,6 +155,10 @@ systray_request_handle(xcb_window_t embed_win, int phys_screen, xembed_info_t *i select_input_val); xwindow_set_state(embed_win, XCB_WM_STATE_WITHDRAWN); + /* we grab the window, but also make sure it's automatically reparented back + * to the root window if we should die. + */ + xcb_change_save_set(globalconf.connection, XCB_SET_MODE_INSERT, embed_win); xcb_reparent_window(globalconf.connection, embed_win, globalconf.screens.tab[phys_screen].systray.window, 0, 0);