Kick out the systray when wiping a wibox

When a wibox is destroyed or detached from a screen, it is wiped to clean up its
resources. This also includes destroying the window which is associated with the
wibox.

The problem here is that if the wibox contains the systray, the systray window
would automatically be destroyed since all childs of a window are destroyed when
said window is destroyed. To fix this, we kick out the systray window before
destroying the wibox' window.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-07-18 09:54:30 +02:00
parent 94a0349c62
commit d7d70714d7
1 changed files with 5 additions and 0 deletions

View File

@ -692,9 +692,14 @@ wibox_wipe(wibox_t *w)
{ {
if(w->window) if(w->window)
{ {
int phys_screen = w->ctx.phys_screen;
/* Activate BMA */ /* Activate BMA */
client_ignore_enterleave_events(); client_ignore_enterleave_events();
xcb_destroy_window(globalconf.connection, w->window); xcb_destroy_window(globalconf.connection, w->window);
/* Make sure we don't accidentally kill the systray window */
if(globalconf.screens.tab[phys_screen].systray.parent == w->window)
wibox_systray_kickout(phys_screen);
/* Deactivate BMA */ /* Deactivate BMA */
client_restore_enterleave_events(); client_restore_enterleave_events();
w->window = XCB_NONE; w->window = XCB_NONE;