Unmap the systray immediately when it becomes empty

The new widget layout code was created because we needed to support partial
redraws (only redraw the parts that were changed). Thanks to this, the code also
skips drawing widgets of size 0x0. Thus, when the systray becomes empty, it's
:draw() callback isn't invoked and thus our systray container window stays
visible.

Fix this by making the C code unconditionally hide the systray when it becomes
empty. There's nothing to display anyway.

Fixes https://github.com/awesomeWM/awesome/issues/624

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-01-15 17:21:26 +01:00
parent 55b90cbd30
commit 8b3087dc4e
1 changed files with 4 additions and 3 deletions

View File

@ -254,6 +254,10 @@ luaA_systray_invalidate(void)
{
lua_State *L = globalconf_get_lua_State();
signal_object_emit(L, &global_signals, "systray::update", 0);
/* Unmap now if the systray became empty */
if(globalconf.embedded.len == 0)
xcb_unmap_window(globalconf.connection, globalconf.systray.window);
}
static void
@ -364,9 +368,6 @@ luaA_systray(lua_State *L)
xcb_map_window(globalconf.connection,
globalconf.systray.window);
}
else
xcb_unmap_window(globalconf.connection,
globalconf.systray.window);
}
lua_pushinteger(L, globalconf.embedded.len);