From 2661e87d839b9d3304f82a3fe9ba15db4e4a654d Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Wed, 26 Oct 2016 15:17:33 +0200 Subject: [PATCH] fix(tray): Synchrounous unmap of empty tray window --- include/components/x11/tray.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/components/x11/tray.hpp b/include/components/x11/tray.hpp index 3a41844b..280f628a 100644 --- a/include/components/x11/tray.hpp +++ b/include/components/x11/tray.hpp @@ -231,9 +231,10 @@ class traymanager void reconfigure() { // Ignore reconfigure requests when the // tray window is in the pseudo-hidden state - if (m_hidden) { + if (m_hidden) + return; + if (m_tray == XCB_NONE) return; - } uint32_t width = 0; uint16_t mapped_clients = 0; @@ -249,18 +250,20 @@ class traymanager g_signals::tray::report_slotcount(mapped_clients); if (!width && m_mapped) { - m_connection.unmap_window(m_tray); + m_connection.unmap_window_checked(m_tray); return; } else if (width && !m_mapped) { - m_connection.map_window(m_tray); + m_connection.map_window_checked(m_tray); m_lastwidth = 0; return; } else if (!width) { return; } - if ((width += m_settings.spacing) == m_lastwidth) + if ((width += m_settings.spacing) == m_lastwidth) { return; + } + m_lastwidth = width; // update window