aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormarkt <markt>2006-12-17 22:21:23 (GMT)
committermarkt <markt>2006-12-17 22:21:23 (GMT)
commit2ff67d09a733e8e986e8f212bb02dd3d5fef40ee (patch)
tree973e525439783f087a61410756757d045afcad3f /src
parentecb0d95b8fdb98137236dfb17fdf0ebe384b6c29 (diff)
downloadfluxbox-2ff67d09a733e8e986e8f212bb02dd3d5fef40ee.zip
fluxbox-2ff67d09a733e8e986e8f212bb02dd3d5fef40ee.tar.bz2
Stop cycling focus when another command gets run, even if modifiers are still down
Diffstat (limited to 'src')
-rw-r--r--src/WorkspaceCmd.cc6
-rw-r--r--src/fluxbox.cc14
2 files changed, 14 insertions, 6 deletions
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() {
54 else { 54 else {
55 // if stacked cycling, then set a watch for 55 // if stacked cycling, then set a watch for
56 // the release of exactly these modifiers 56 // the release of exactly these modifiers
57 if (screen != fb->watchingScreen()) 57 Fluxbox::instance()->watchKeyRelease(*screen, mods);
58 Fluxbox::instance()->watchKeyRelease(*screen, mods);
59 screen->focusControl().nextFocus(m_option); 58 screen->focusControl().nextFocus(m_option);
60 } 59 }
61 } else 60 } else
@@ -76,8 +75,7 @@ void PrevWindowCmd::execute() {
76 else { 75 else {
77 // if stacked cycling, then set a watch for 76 // if stacked cycling, then set a watch for
78 // the release of exactly these modifiers 77 // the release of exactly these modifiers
79 if (screen != fb->watchingScreen()) 78 Fluxbox::instance()->watchKeyRelease(*screen, mods);
80 Fluxbox::instance()->watchKeyRelease(*screen, mods);
81 screen->focusControl().prevFocus(m_option); 79 screen->focusControl().prevFocus(m_option);
82 } 80 }
83 } else 81 } 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) {
1113 if (keyScreen() == 0 || mouseScreen() == 0) 1113 if (keyScreen() == 0 || mouseScreen() == 0)
1114 return; 1114 return;
1115 1115
1116 BScreen *old_watching_screen = m_watching_screen;
1117
1116 switch (ke.type) { 1118 switch (ke.type) {
1117 case KeyPress: 1119 case KeyPress:
1118 if (m_key->doAction(ke)) 1120 // see if we need to keep watching for key releases
1121 m_watching_screen = 0;
1122 if (m_key->doAction(ke)) {
1119 XAllowEvents(FbTk::App::instance()->display(), AsyncKeyboard, CurrentTime); 1123 XAllowEvents(FbTk::App::instance()->display(), AsyncKeyboard, CurrentTime);
1120 else 1124 // if we've done some action other than cycling focus
1125 if (old_watching_screen && m_watching_screen != old_watching_screen)
1126 old_watching_screen->notifyReleasedKeys(ke);
1127 } else {
1121 XAllowEvents(FbTk::App::instance()->display(), ReplayKeyboard, CurrentTime); 1128 XAllowEvents(FbTk::App::instance()->display(), ReplayKeyboard, CurrentTime);
1129 // could still be cycling
1130 m_watching_screen = old_watching_screen;
1131 }
1122 break; 1132 break;
1123 case KeyRelease: { 1133 case KeyRelease: {
1124 // we ignore most key releases unless we need to use 1134 // we ignore most key releases unless we need to use