From c2cc8cb8b8d23bcf85d0367cf5ba01ffcb9a1cee Mon Sep 17 00:00:00 2001 From: rathnor Date: Thu, 1 May 2003 15:35:24 +0000 Subject: autohide tweak --- src/Slit.cc | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/Slit.cc b/src/Slit.cc index df05b4f..f55fc5b 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Slit.cc,v 1.43 2003/05/01 15:03:36 rathnor Exp $ +// $Id: Slit.cc,v 1.44 2003/05/01 15:35:24 rathnor Exp $ #include "Slit.hh" @@ -1007,14 +1007,13 @@ void Slit::leaveNotifyEvent(XCrossingEvent &ev) { if (hidden) { if (timer.isTiming()) timer.stop(); - } else if (! slitmenu.isVisible()) { - if (! timer.isTiming()) - timer.start(); } else { - // the menu is open, keep it firing until it closes - timer.fireOnce(false); - if (! timer.isTiming()) + if (! timer.isTiming()) { + // the menu is open, keep it firing until it closes + if (slitmenu.isVisible()) + timer.fireOnce(false); timer.start(); + } } } @@ -1057,10 +1056,14 @@ void Slit::configureRequestEvent(XConfigureRequestEvent &event) { void Slit::timeout() { - if (!slitmenu.isVisible()) { - timer.fireOnce(true); + if (do_auto_hide) { + if (!slitmenu.isVisible()) { + timer.fireOnce(true); + } else + return; } else - return; + if (!hidden) return; + hidden = ! hidden; // toggle hidden state if (hidden) frame.window.move(frame.x_hidden, frame.y_hidden); @@ -1129,6 +1132,12 @@ void Slit::saveClientList() { void Slit::setAutoHide(bool val) { do_auto_hide = val; screen().saveSlitAutoHide(val); + if (do_auto_hide) + if (! timer.isTiming()) { + if (slitmenu.isVisible()) + timer.fireOnce(false); + timer.start(); + } } void Slit::setupMenu() { -- cgit v0.11.2