diff options
author | markt <markt> | 2007-10-13 21:51:37 (GMT) |
---|---|---|
committer | markt <markt> | 2007-10-13 21:51:37 (GMT) |
commit | a59428d67a95a9df16554962f0a6257d6378328a (patch) | |
tree | f856ed9300c34f7a17d499f22d895610cfbc08e5 /src/WorkspaceCmd.cc | |
parent | 41b5c6dadb1f474675660cef18b812d4c2338ed2 (diff) | |
download | fluxbox_pavel-a59428d67a95a9df16554962f0a6257d6378328a.zip fluxbox_pavel-a59428d67a95a9df16554962f0a6257d6378328a.tar.bz2 |
merged changes from pre-devel
Diffstat (limited to 'src/WorkspaceCmd.cc')
-rw-r--r-- | src/WorkspaceCmd.cc | 91 |
1 files changed, 76 insertions, 15 deletions
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index 9859dd6..e7d92ee 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc | |||
@@ -41,16 +41,90 @@ | |||
41 | #include <algorithm> | 41 | #include <algorithm> |
42 | #include <functional> | 42 | #include <functional> |
43 | 43 | ||
44 | void WindowListCmd::execute() { | ||
45 | if (m_pat.error()) { | ||
46 | m_cmd->execute(); | ||
47 | return; | ||
48 | } | ||
49 | |||
50 | BScreen *screen = Fluxbox::instance()->keyScreen(); | ||
51 | if (screen != 0) { | ||
52 | FocusControl::Focusables win_list(screen->focusControl().creationOrderWinList()); | ||
53 | |||
54 | FocusControl::Focusables::iterator it = win_list.begin(), | ||
55 | it_end = win_list.end(); | ||
56 | for (; it != it_end; ++it) { | ||
57 | if (m_pat.match(**it) && (*it)->fbwindow()) | ||
58 | m_cmd->execute(*(*it)->fbwindow()); | ||
59 | } | ||
60 | } | ||
61 | } | ||
62 | |||
63 | void AttachCmd::execute() { | ||
64 | BScreen *screen = Fluxbox::instance()->keyScreen(); | ||
65 | if (screen != 0) { | ||
66 | FocusControl::Focusables win_list(screen->focusControl().focusedOrderWinList()); | ||
67 | |||
68 | FocusControl::Focusables::iterator it = win_list.begin(), | ||
69 | it_end = win_list.end(); | ||
70 | FluxboxWindow *first = 0; | ||
71 | for (; it != it_end; ++it) { | ||
72 | if (m_pat.match(**it) && (*it)->fbwindow()) { | ||
73 | if (first == 0) | ||
74 | first = (*it)->fbwindow(); | ||
75 | else | ||
76 | first->attachClient((*it)->fbwindow()->winClient()); | ||
77 | } | ||
78 | } | ||
79 | |||
80 | } | ||
81 | } | ||
82 | |||
44 | void NextWindowCmd::execute() { | 83 | void NextWindowCmd::execute() { |
45 | BScreen *screen = Fluxbox::instance()->keyScreen(); | 84 | BScreen *screen = Fluxbox::instance()->keyScreen(); |
46 | if (screen != 0) | 85 | if (screen != 0) |
47 | screen->cycleFocus(m_option, false); | 86 | screen->cycleFocus(m_option, &m_pat, false); |
48 | } | 87 | } |
49 | 88 | ||
50 | void PrevWindowCmd::execute() { | 89 | void PrevWindowCmd::execute() { |
51 | BScreen *screen = Fluxbox::instance()->keyScreen(); | 90 | BScreen *screen = Fluxbox::instance()->keyScreen(); |
52 | if (screen != 0) | 91 | if (screen != 0) |
53 | screen->cycleFocus(m_option, true); | 92 | screen->cycleFocus(m_option, &m_pat, true); |
93 | } | ||
94 | |||
95 | void TypeAheadFocusCmd::execute() { | ||
96 | BScreen *screen = Fluxbox::instance()->keyScreen(); | ||
97 | if (screen != 0) { | ||
98 | FocusControl::Focusables *win_list = 0; | ||
99 | if (m_option & FocusControl::CYCLEGROUPS) { | ||
100 | win_list = (m_option & FocusControl::CYCLELINEAR) ? | ||
101 | &screen->focusControl().creationOrderWinList() : | ||
102 | &screen->focusControl().focusedOrderWinList(); | ||
103 | } else { | ||
104 | win_list = (m_option & FocusControl::CYCLELINEAR) ? | ||
105 | &screen->focusControl().creationOrderList() : | ||
106 | &screen->focusControl().focusedOrderList(); | ||
107 | } | ||
108 | |||
109 | screen->startTypeAheadFocus(*win_list, &m_pat); | ||
110 | } | ||
111 | } | ||
112 | |||
113 | void GoToWindowCmd::execute() { | ||
114 | BScreen *screen = Fluxbox::instance()->keyScreen(); | ||
115 | if (screen != 0) { | ||
116 | FocusControl::Focusables *win_list = 0; | ||
117 | if (m_option & FocusControl::CYCLEGROUPS) { | ||
118 | win_list = (m_option & FocusControl::CYCLELINEAR) ? | ||
119 | &screen->focusControl().creationOrderWinList() : | ||
120 | &screen->focusControl().focusedOrderWinList(); | ||
121 | } else { | ||
122 | win_list = (m_option & FocusControl::CYCLELINEAR) ? | ||
123 | &screen->focusControl().creationOrderList() : | ||
124 | &screen->focusControl().focusedOrderList(); | ||
125 | } | ||
126 | screen->focusControl().goToWindowNumber(*win_list, m_num, &m_pat); | ||
127 | } | ||
54 | } | 128 | } |
55 | 129 | ||
56 | void DirFocusCmd::execute() { | 130 | void DirFocusCmd::execute() { |
@@ -250,19 +324,6 @@ void ShowDesktopCmd::execute() { | |||
250 | std::mem_fun(&FluxboxWindow::iconify)); | 324 | std::mem_fun(&FluxboxWindow::iconify)); |
251 | } | 325 | } |
252 | 326 | ||
253 | void MinimizeLayerCmd::execute() { | ||
254 | FluxboxWindow *win = FocusControl::focusedFbWindow(); | ||
255 | if (!win) | ||
256 | return; | ||
257 | |||
258 | Workspace::Windows windows(win->screen().currentWorkspace()->windowList()); | ||
259 | Workspace::Windows::iterator it = windows.begin(), it_end = windows.end(); | ||
260 | for (; it != it_end; ++it) { | ||
261 | if (win->layerNum() == (*it)->layerNum()) | ||
262 | (*it)->iconify(); | ||
263 | } | ||
264 | } | ||
265 | |||
266 | void CloseAllWindowsCmd::execute() { | 327 | void CloseAllWindowsCmd::execute() { |
267 | BScreen *screen = Fluxbox::instance()->mouseScreen(); | 328 | BScreen *screen = Fluxbox::instance()->mouseScreen(); |
268 | if (screen == 0) | 329 | if (screen == 0) |