aboutsummaryrefslogtreecommitdiff
path: root/src/WorkspaceCmd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/WorkspaceCmd.cc')
-rw-r--r--src/WorkspaceCmd.cc34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
index 414f942..7d384aa 100644
--- a/src/WorkspaceCmd.cc
+++ b/src/WorkspaceCmd.cc
@@ -53,14 +53,19 @@ void NextWindowCmd::execute() {
53 } else if (ev.type == ButtonPress) { 53 } else if (ev.type == ButtonPress) {
54 mods = FbTk::KeyUtil::instance().cleanMods(ev.xbutton.state); 54 mods = FbTk::KeyUtil::instance().cleanMods(ev.xbutton.state);
55 } 55 }
56 int options = m_option;
56 if (mods == 0) // can't stacked cycle unless there is a mod to grab 57 if (mods == 0) // can't stacked cycle unless there is a mod to grab
57 screen->focusControl().nextFocus(m_option | FocusControl::CYCLELINEAR); 58 options |= FocusControl::CYCLELINEAR;
58 else { 59 else
59 // if stacked cycling, then set a watch for 60 // set a watch for the release of exactly these modifiers
60 // the release of exactly these modifiers
61 fb->watchKeyRelease(*screen, mods); 61 fb->watchKeyRelease(*screen, mods);
62 screen->focusControl().nextFocus(m_option); 62
63 } 63 FocusControl::FocusedWindows *win_list =
64 (options & FocusControl::CYCLELINEAR) ?
65 &screen->focusControl().creationOrderList() :
66 &screen->focusControl().focusedOrderList();
67
68 screen->focusControl().cycleFocus(win_list, m_option);
64 } 69 }
65} 70}
66 71
@@ -76,14 +81,19 @@ void PrevWindowCmd::execute() {
76 } else if (ev.type == ButtonPress) { 81 } else if (ev.type == ButtonPress) {
77 mods = FbTk::KeyUtil::instance().cleanMods(ev.xbutton.state); 82 mods = FbTk::KeyUtil::instance().cleanMods(ev.xbutton.state);
78 } 83 }
84 int options = m_option;
79 if (mods == 0) // can't stacked cycle unless there is a mod to grab 85 if (mods == 0) // can't stacked cycle unless there is a mod to grab
80 screen->focusControl().prevFocus(m_option | FocusControl::CYCLELINEAR); 86 options |= FocusControl::CYCLELINEAR;
81 else { 87 else
82 // if stacked cycling, then set a watch for 88 // set a watch for the release of exactly these modifiers
83 // the release of exactly these modifiers
84 fb->watchKeyRelease(*screen, mods); 89 fb->watchKeyRelease(*screen, mods);
85 screen->focusControl().prevFocus(m_option); 90
86 } 91 FocusControl::FocusedWindows *win_list =
92 (options & FocusControl::CYCLELINEAR) ?
93 &screen->focusControl().creationOrderList() :
94 &screen->focusControl().focusedOrderList();
95
96 screen->focusControl().cycleFocus(win_list, m_option, true);
87 } 97 }
88} 98}
89 99