From 35c05abe2901e4352086a378670a6c8d7c24bd12 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 7 Oct 2010 11:31:51 +0200 Subject: [PATCH] Systray: Fix some flickering Every time the systray was updated, we reparented the systray window to its drawin. However, when the systray was already reparented, this still caused it to be unmapped and mapped again. So, we only should reparent the systray when we have to, and not always just for the lulz. Signed-off-by: Uli Schlachter --- systray.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/systray.c b/systray.c index b1877a7e7..9fbaa1e9e 100644 --- a/systray.c +++ b/systray.c @@ -328,14 +328,24 @@ luaA_systray(lua_State *L) if(globalconf.systray.parent == NULL) systray_register(); - globalconf.systray.parent = w; - - if(globalconf.embedded.len != 0) - { + if(globalconf.systray.parent != w) xcb_reparent_window(globalconf.connection, globalconf.systray.window, w->window, x, y); + else + { + uint32_t config_vals[2] = { x, y }; + xcb_configure_window(globalconf.connection, + globalconf.systray.window, + XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, + config_vals); + } + + globalconf.systray.parent = w; + + if(globalconf.embedded.len != 0) + { systray_update(base_size, horiz); xcb_map_window(globalconf.connection, globalconf.systray.window);