diff options
author | rathnor <rathnor> | 2003-04-27 04:56:18 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2003-04-27 04:56:18 (GMT) |
commit | 2fb9e90627c613db822ca077d55dce14f5fe672a (patch) | |
tree | a2ed881a246c28a4962a09c9ecf4d7014c0f53d1 /src | |
parent | 64d7fa3b9644bedf86163e86be20f43262866396 (diff) | |
download | fluxbox_paul-2fb9e90627c613db822ca077d55dce14f5fe672a.zip fluxbox_paul-2fb9e90627c613db822ca077d55dce14f5fe672a.tar.bz2 |
fix bug for not using modifiers on nextWindow
Diffstat (limited to 'src')
-rw-r--r-- | src/fluxbox.cc | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 7b33e49..5de7d8d 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: fluxbox.cc,v 1.121 2003/04/27 04:28:04 rathnor Exp $ | 25 | // $Id: fluxbox.cc,v 1.122 2003/04/27 04:56:18 rathnor Exp $ |
26 | 26 | ||
27 | #include "fluxbox.hh" | 27 | #include "fluxbox.hh" |
28 | 28 | ||
@@ -1097,21 +1097,35 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) { | |||
1097 | } | 1097 | } |
1098 | break; | 1098 | break; |
1099 | case Keys::NEXTWINDOW: //activate next window | 1099 | case Keys::NEXTWINDOW: //activate next window |
1100 | { | ||
1101 | unsigned int mods = Keys::cleanMods(ke.state); | ||
1102 | if (mods == 0) { // can't stacked cycle unless there is a mod to grab | ||
1103 | screen->nextFocus(m_key->getParam() | BScreen::CYCLELINEAR); | ||
1104 | break; | ||
1105 | } | ||
1100 | if (!m_watching_screen && !(m_key->getParam() & BScreen::CYCLELINEAR)) { | 1106 | if (!m_watching_screen && !(m_key->getParam() & BScreen::CYCLELINEAR)) { |
1101 | // if stacked cycling, then set a watch for | 1107 | // if stacked cycling, then set a watch for |
1102 | // the release of exactly these modifiers | 1108 | // the release of exactly these modifiers |
1103 | watchKeyRelease(screen, Keys::cleanMods(ke.state)); | 1109 | watchKeyRelease(screen, mods); |
1104 | } | 1110 | } |
1105 | screen->nextFocus(m_key->getParam()); | 1111 | screen->nextFocus(m_key->getParam()); |
1106 | break; | 1112 | break; |
1113 | } | ||
1107 | case Keys::PREVWINDOW: //activate prev window | 1114 | case Keys::PREVWINDOW: //activate prev window |
1115 | { | ||
1116 | unsigned int mods = Keys::cleanMods(ke.state); | ||
1117 | if (mods == 0) { // can't stacked cycle unless there is a mod to grab | ||
1118 | screen->prevFocus(m_key->getParam() | BScreen::CYCLELINEAR); | ||
1119 | break; | ||
1120 | } | ||
1108 | if (!m_watching_screen && !(m_key->getParam() & BScreen::CYCLELINEAR)) { | 1121 | if (!m_watching_screen && !(m_key->getParam() & BScreen::CYCLELINEAR)) { |
1109 | // if stacked cycling, then set a watch for | 1122 | // if stacked cycling, then set a watch for |
1110 | // the release of exactly these modifiers | 1123 | // the release of exactly these modifiers |
1111 | watchKeyRelease(screen, Keys::cleanMods(ke.state)); | 1124 | watchKeyRelease(screen, mods); |
1112 | } | 1125 | } |
1113 | screen->prevFocus(m_key->getParam()); | 1126 | screen->prevFocus(m_key->getParam()); |
1114 | break; | 1127 | break; |
1128 | } | ||
1115 | case Keys::FOCUSUP: | 1129 | case Keys::FOCUSUP: |
1116 | if (m_focused_window) | 1130 | if (m_focused_window) |
1117 | screen->dirFocus(*m_focused_window, BScreen::FOCUSUP); | 1131 | screen->dirFocus(*m_focused_window, BScreen::FOCUSUP); |
@@ -2255,6 +2269,10 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) { | |||
2255 | } | 2269 | } |
2256 | 2270 | ||
2257 | void Fluxbox::watchKeyRelease(BScreen *screen, unsigned int mods) { | 2271 | void Fluxbox::watchKeyRelease(BScreen *screen, unsigned int mods) { |
2272 | if (mods == 0) { | ||
2273 | cerr<<"WARNING: attempt to grab without modifiers!"<<endl; | ||
2274 | return; | ||
2275 | } | ||
2258 | m_watching_screen = screen; | 2276 | m_watching_screen = screen; |
2259 | m_watch_keyrelease = mods; | 2277 | m_watch_keyrelease = mods; |
2260 | XGrabKeyboard(FbTk::App::instance()->display(), | 2278 | XGrabKeyboard(FbTk::App::instance()->display(), |