Stop cycling focus when another command gets run, even if modifiers are still down
markt markt
3 files changed,
17 insertions(+),
6 deletions(-)
M
src/WorkspaceCmd.cc
→
src/WorkspaceCmd.cc
@@ -54,8 +54,7 @@ screen->focusControl().nextFocus(m_option | FocusControl::CYCLELINEAR);
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 @@ screen->focusControl().prevFocus(m_option | FocusControl::CYCLELINEAR);
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
M
src/fluxbox.cc
→
src/fluxbox.cc
@@ -1113,12 +1113,22 @@
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