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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-07-14 17:26:55 +02:00
parent 84150be3df
commit 775ea16efa
1 changed files with 4 additions and 0 deletions

View File

@ -155,6 +155,10 @@ systray_request_handle(xcb_window_t embed_win, int phys_screen, xembed_info_t *i
select_input_val); select_input_val);
window_state_set(embed_win, XCB_WM_STATE_WITHDRAWN); window_state_set(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, xcb_reparent_window(globalconf.connection, embed_win,
globalconf.screens.tab[phys_screen].systray.window, globalconf.screens.tab[phys_screen].systray.window,
0, 0); 0, 0);