From 2ff67d09a733e8e986e8f212bb02dd3d5fef40ee Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 17 Dec 2006 22:21:23 +0000 Subject: Stop cycling focus when another command gets run, even if modifiers are still down --- ChangeLog | 3 +++ src/WorkspaceCmd.cc | 6 ++---- src/fluxbox.cc | 14 ++++++++++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e35795e..cc266a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0rc3: +*06/12/17: + * Stop cycling focus when any other command is run, e.g. bug #1595336 (Mark) + fluxbox.cc WorkspaceCmd.cc *06/12/16: * Remove useless stuff from code that reloads configuration (Mark) fluxbox.cc diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index 2ced53f..204d1b9 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc @@ -54,8 +54,7 @@ void NextWindowCmd::execute() { else { // if stacked cycling, then set a watch for // the release of exactly these modifiers - if (screen != fb->watchingScreen()) - Fluxbox::instance()->watchKeyRelease(*screen, mods); + Fluxbox::instance()->watchKeyRelease(*screen, mods); screen->focusControl().nextFocus(m_option); } } else @@ -76,8 +75,7 @@ void PrevWindowCmd::execute() { else { // if stacked cycling, then set a watch for // the release of exactly these modifiers - if (screen != fb->watchingScreen()) - Fluxbox::instance()->watchKeyRelease(*screen, mods); + Fluxbox::instance()->watchKeyRelease(*screen, mods); screen->focusControl().prevFocus(m_option); } } else diff --git a/src/fluxbox.cc b/src/fluxbox.cc index fdc5d37..8a810a4 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -1113,12 +1113,22 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) { if (keyScreen() == 0 || mouseScreen() == 0) return; + BScreen *old_watching_screen = m_watching_screen; + switch (ke.type) { case KeyPress: - if (m_key->doAction(ke)) + // see if we need to keep watching for key releases + m_watching_screen = 0; + if (m_key->doAction(ke)) { XAllowEvents(FbTk::App::instance()->display(), AsyncKeyboard, CurrentTime); - else + // if we've done some action other than cycling focus + if (old_watching_screen && m_watching_screen != old_watching_screen) + old_watching_screen->notifyReleasedKeys(ke); + } else { XAllowEvents(FbTk::App::instance()->display(), ReplayKeyboard, CurrentTime); + // could still be cycling + m_watching_screen = old_watching_screen; + } break; case KeyRelease: { // we ignore most key releases unless we need to use -- cgit v0.11.2