aboutsummaryrefslogtreecommitdiff
path: root/src/WorkspaceCmd.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-03-04 17:47:37 (GMT)
committermarkt <markt>2007-03-04 17:47:37 (GMT)
commit4c1a242968dff12e504f281224819b7cd3850a04 (patch)
tree42a6e3de02153bc8f35cae43f89238d73e9b821a /src/WorkspaceCmd.cc
parent9477af82a5835b7336fec8879967abb67f3bd848 (diff)
downloadfluxbox-4c1a242968dff12e504f281224819b7cd3850a04.zip
fluxbox-4c1a242968dff12e504f281224819b7cd3850a04.tar.bz2
moved some code around (regarding event handling) in preparation for upcoming features
Diffstat (limited to 'src/WorkspaceCmd.cc')
-rw-r--r--src/WorkspaceCmd.cc56
1 files changed, 6 insertions, 50 deletions
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
index 7d384aa..0cbf5b9 100644
--- a/src/WorkspaceCmd.cc
+++ b/src/WorkspaceCmd.cc
@@ -42,59 +42,15 @@
42#include <functional> 42#include <functional>
43 43
44void NextWindowCmd::execute() { 44void NextWindowCmd::execute() {
45 Fluxbox *fb = Fluxbox::instance(); 45 BScreen *screen = Fluxbox::instance()->keyScreen();
46 BScreen *screen = fb->keyScreen(); 46 if (screen != 0)
47 if (screen != 0) { 47 screen->cycleFocus(m_option, false);
48 // get modifiers from event that causes this for focus order cycling
49 unsigned int mods = 0;
50 XEvent ev = fb->lastEvent();
51 if (ev.type == KeyPress) {
52 mods = FbTk::KeyUtil::instance().cleanMods(ev.xkey.state);
53 } else if (ev.type == ButtonPress) {
54 mods = FbTk::KeyUtil::instance().cleanMods(ev.xbutton.state);
55 }
56 int options = m_option;
57 if (mods == 0) // can't stacked cycle unless there is a mod to grab
58 options |= FocusControl::CYCLELINEAR;
59 else
60 // set a watch for the release of exactly these modifiers
61 fb->watchKeyRelease(*screen, mods);
62
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);
69 }
70} 48}
71 49
72void PrevWindowCmd::execute() { 50void PrevWindowCmd::execute() {
73 Fluxbox *fb = Fluxbox::instance(); 51 BScreen *screen = Fluxbox::instance()->keyScreen();
74 BScreen *screen = fb->keyScreen(); 52 if (screen != 0)
75 if (screen != 0) { 53 screen->cycleFocus(m_option, true);
76 // get modifiers from event that causes this for focus order cycling
77 unsigned int mods = 0;
78 XEvent ev = fb->lastEvent();
79 if (ev.type == KeyPress) {
80 mods = FbTk::KeyUtil::instance().cleanMods(ev.xkey.state);
81 } else if (ev.type == ButtonPress) {
82 mods = FbTk::KeyUtil::instance().cleanMods(ev.xbutton.state);
83 }
84 int options = m_option;
85 if (mods == 0) // can't stacked cycle unless there is a mod to grab
86 options |= FocusControl::CYCLELINEAR;
87 else
88 // set a watch for the release of exactly these modifiers
89 fb->watchKeyRelease(*screen, mods);
90
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);
97 }
98} 54}
99 55
100void DirFocusCmd::execute() { 56void DirFocusCmd::execute() {