From 8b3087dc4ee9a9d2fc8985af2178f6bc245e63d3 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 15 Jan 2016 17:21:26 +0100 Subject: [PATCH] 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 --- systray.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/systray.c b/systray.c index 88a6cbdee..fea74449b 100644 --- a/systray.c +++ b/systray.c @@ -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);