From 50b6102bbf998fc1d8393d4d48bf9507c359a9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 24 Jul 2016 16:51:50 +0200 Subject: flag slit for reconfiguration and act on show According to Peter Ganzhorn, there's a transparency issue when using an autohiding slit, but I don't use a slit at all. However, the explanations in the bug do make sense and this is just an alternative approach on the problem (that does not require interim showing) BUG: 1132 --- src/Slit.cc | 17 ++++++++++++++--- src/Slit.hh | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Slit.cc b/src/Slit.cc index 1851a16..57de638 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -207,7 +207,7 @@ unsigned int Slit::s_eventmask = SubstructureRedirectMask | ButtonPressMask | EnterWindowMask | LeaveWindowMask | ExposureMask; Slit::Slit(BScreen &scr, FbTk::Layer &layer, const char *filename) - : m_hidden(false), m_visible(false), + : m_hidden(false), m_visible(false), m_pending_reconfigure(false), m_screen(scr), m_clientlist_menu(scr.menuTheme(), scr.imageControl(), @@ -565,6 +565,12 @@ void Slit::removeClient(Window w, bool remap) { void Slit::reconfigure() { + bool allow_autohide = true; + if (m_hidden) + m_pending_reconfigure = true; + else if (m_pending_reconfigure) + allow_autohide = false; // this is for a pending one, triggerd by unhide + frame.width = 0; frame.height = 0; @@ -720,7 +726,7 @@ void Slit::reconfigure() { x += (*client_it)->width() + bevel_width; } // end for - if (doAutoHide() && !isHidden() && !m_timer.isTiming()) + if (allow_autohide && doAutoHide() && !isHidden() && !m_timer.isTiming()) m_timer.start(); else if (!doAutoHide() && isHidden()) toggleHidden(); // restore visible @@ -1049,8 +1055,13 @@ void Slit::toggleHidden() { m_hidden = ! m_hidden; // toggle hidden state if (isHidden()) frame.window.move(frame.x_hidden, frame.y_hidden); - else + else { frame.window.move(frame.x, frame.y); + if (m_pending_reconfigure) { + reconfigure(); + m_pending_reconfigure = false; + } + } } void Slit::loadClientList(const char *filename) { diff --git a/src/Slit.hh b/src/Slit.hh index 92eac35..7d643d6 100644 --- a/src/Slit.hh +++ b/src/Slit.hh @@ -144,6 +144,7 @@ private: // m_hidden is for autohide, m_visible is the FbWindow state bool m_hidden, m_visible; + bool m_pending_reconfigure; BScreen &m_screen; FbTk::Timer m_timer; -- cgit v0.11.2