diff options
author | markt <markt> | 2007-03-04 17:47:37 (GMT) |
---|---|---|
committer | markt <markt> | 2007-03-04 17:47:37 (GMT) |
commit | 4c1a242968dff12e504f281224819b7cd3850a04 (patch) | |
tree | 42a6e3de02153bc8f35cae43f89238d73e9b821a /src/WorkspaceCmd.cc | |
parent | 9477af82a5835b7336fec8879967abb67f3bd848 (diff) | |
download | fluxbox-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.cc | 56 |
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 | ||
44 | void NextWindowCmd::execute() { | 44 | void 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 | ||
72 | void PrevWindowCmd::execute() { | 50 | void 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 | ||
100 | void DirFocusCmd::execute() { | 56 | void DirFocusCmd::execute() { |