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
This commit is contained in:
Thomas Lübking 2016-07-24 16:51:50 +02:00 committed by Mathias Gumz
parent dc226902a7
commit 50b6102bbf
2 changed files with 15 additions and 3 deletions

View file

@ -207,7 +207,7 @@ unsigned int Slit::s_eventmask = SubstructureRedirectMask | ButtonPressMask |
EnterWindowMask | LeaveWindowMask | ExposureMask; EnterWindowMask | LeaveWindowMask | ExposureMask;
Slit::Slit(BScreen &scr, FbTk::Layer &layer, const char *filename) 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_screen(scr),
m_clientlist_menu(scr.menuTheme(), m_clientlist_menu(scr.menuTheme(),
scr.imageControl(), scr.imageControl(),
@ -565,6 +565,12 @@ void Slit::removeClient(Window w, bool remap) {
void Slit::reconfigure() { 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.width = 0;
frame.height = 0; frame.height = 0;
@ -720,7 +726,7 @@ void Slit::reconfigure() {
x += (*client_it)->width() + bevel_width; x += (*client_it)->width() + bevel_width;
} // end for } // end for
if (doAutoHide() && !isHidden() && !m_timer.isTiming()) if (allow_autohide && doAutoHide() && !isHidden() && !m_timer.isTiming())
m_timer.start(); m_timer.start();
else if (!doAutoHide() && isHidden()) else if (!doAutoHide() && isHidden())
toggleHidden(); // restore visible toggleHidden(); // restore visible
@ -1049,8 +1055,13 @@ void Slit::toggleHidden() {
m_hidden = ! m_hidden; // toggle hidden state m_hidden = ! m_hidden; // toggle hidden state
if (isHidden()) if (isHidden())
frame.window.move(frame.x_hidden, frame.y_hidden); frame.window.move(frame.x_hidden, frame.y_hidden);
else else {
frame.window.move(frame.x, frame.y); frame.window.move(frame.x, frame.y);
if (m_pending_reconfigure) {
reconfigure();
m_pending_reconfigure = false;
}
}
} }
void Slit::loadClientList(const char *filename) { void Slit::loadClientList(const char *filename) {

View file

@ -144,6 +144,7 @@ private:
// m_hidden is for autohide, m_visible is the FbWindow state // m_hidden is for autohide, m_visible is the FbWindow state
bool m_hidden, m_visible; bool m_hidden, m_visible;
bool m_pending_reconfigure;
BScreen &m_screen; BScreen &m_screen;
FbTk::Timer m_timer; FbTk::Timer m_timer;