diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-04 01:18:04 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-04 01:18:04 (GMT) |
commit | 0688816d11e1fbd5576197f39f949ead687101d9 (patch) | |
tree | 81d7b4f9c4a14e4fe9f976012fe0719f810d17f3 | |
parent | 1be92e79eca2ef3b9c99655302ac5d1c0d91e14b (diff) | |
download | fluxbox-0688816d11e1fbd5576197f39f949ead687101d9.zip fluxbox-0688816d11e1fbd5576197f39f949ead687101d9.tar.bz2 |
add window pattern argument to ArrangeWindows
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/WorkspaceCmd.cc | 22 | ||||
-rw-r--r-- | src/WorkspaceCmd.hh | 3 |
3 files changed, 16 insertions, 12 deletions
@@ -1,5 +1,8 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 1.1 | 2 | Changes for 1.1 |
3 | *08/08/04: | ||
4 | * Add window list argument to ArrangeWindows (Mark) | ||
5 | WorkspaceCmd.cc/hh | ||
3 | *08/06/26: | 6 | *08/06/26: |
4 | * Remove antiquated dithering code (Mark) | 7 | * Remove antiquated dithering code (Mark) |
5 | FbTk/ImageControl.cc/hh FbTk/TextureRender.cc Screen.cc/hh | 8 | FbTk/ImageControl.cc/hh FbTk/TextureRender.cc Screen.cc/hh |
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index aba5914..4bd9c7e 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc | |||
@@ -173,7 +173,8 @@ FbTk::Command<void> *parseWindowList(const string &command, | |||
173 | else if (command == "prevgroup") { | 173 | else if (command == "prevgroup") { |
174 | opts |= FocusableList::LIST_GROUPS; | 174 | opts |= FocusableList::LIST_GROUPS; |
175 | return new PrevWindowCmd(opts, pat); | 175 | return new PrevWindowCmd(opts, pat); |
176 | } | 176 | } else if (command == "arrangewindows") |
177 | return new ArrangeWindowsCmd(pat); | ||
177 | return 0; | 178 | return 0; |
178 | } | 179 | } |
179 | 180 | ||
@@ -182,6 +183,7 @@ REGISTER_COMMAND_PARSER(nextwindow, parseWindowList, void); | |||
182 | REGISTER_COMMAND_PARSER(nextgroup, parseWindowList, void); | 183 | REGISTER_COMMAND_PARSER(nextgroup, parseWindowList, void); |
183 | REGISTER_COMMAND_PARSER(prevwindow, parseWindowList, void); | 184 | REGISTER_COMMAND_PARSER(prevwindow, parseWindowList, void); |
184 | REGISTER_COMMAND_PARSER(prevgroup, parseWindowList, void); | 185 | REGISTER_COMMAND_PARSER(prevgroup, parseWindowList, void); |
186 | REGISTER_COMMAND_PARSER(arrangewindows, parseWindowList, void); | ||
185 | 187 | ||
186 | }; // end anonymous namespace | 188 | }; // end anonymous namespace |
187 | 189 | ||
@@ -353,8 +355,6 @@ void JumpToWorkspaceCmd::execute() { | |||
353 | } | 355 | } |
354 | } | 356 | } |
355 | 357 | ||
356 | REGISTER_COMMAND(arrangewindows, ArrangeWindowsCmd, void); | ||
357 | |||
358 | /** | 358 | /** |
359 | try to arrange the windows on the current workspace in a 'clever' way. | 359 | try to arrange the windows on the current workspace in a 'clever' way. |
360 | we take the shaded-windows and put them ontop of the workspace and put the | 360 | we take the shaded-windows and put them ontop of the workspace and put the |
@@ -366,9 +366,8 @@ void ArrangeWindowsCmd::execute() { | |||
366 | return; | 366 | return; |
367 | 367 | ||
368 | Workspace *space = screen->currentWorkspace(); | 368 | Workspace *space = screen->currentWorkspace(); |
369 | size_t win_count = space->windowList().size(); | ||
370 | 369 | ||
371 | if (win_count == 0) | 370 | if (space->windowList().empty()) |
372 | return; | 371 | return; |
373 | 372 | ||
374 | // TODO: choice between | 373 | // TODO: choice between |
@@ -382,20 +381,19 @@ void ArrangeWindowsCmd::execute() { | |||
382 | Workspace::Windows shaded_windows; | 381 | Workspace::Windows shaded_windows; |
383 | for(win = space->windowList().begin(); win != space->windowList().end(); win++) { | 382 | for(win = space->windowList().begin(); win != space->windowList().end(); win++) { |
384 | int winhead = screen->getHead((*win)->fbWindow()); | 383 | int winhead = screen->getHead((*win)->fbWindow()); |
385 | if (winhead == head || winhead == 0) { | 384 | if ((winhead == head || winhead == 0) && m_pat.match(**win)) { |
386 | if (!(*win)->isShaded()) | 385 | if ((*win)->isShaded()) |
387 | normal_windows.push_back(*win); | ||
388 | else | ||
389 | shaded_windows.push_back(*win); | 386 | shaded_windows.push_back(*win); |
387 | else | ||
388 | normal_windows.push_back(*win); | ||
390 | } | 389 | } |
391 | } | 390 | } |
392 | 391 | ||
393 | // to arrange only shaded windows is a bit pointless imho (mathias) | 392 | // to arrange only shaded windows is a bit pointless imho (mathias) |
394 | if (normal_windows.size() == 0) | 393 | size_t win_count = normal_windows.size(); |
394 | if (win_count == 0) | ||
395 | return; | 395 | return; |
396 | 396 | ||
397 | win_count = normal_windows.size(); | ||
398 | |||
399 | const unsigned int max_width = screen->maxRight(head) - screen->maxLeft(head); | 397 | const unsigned int max_width = screen->maxRight(head) - screen->maxLeft(head); |
400 | unsigned int max_height = screen->maxBottom(head) - screen->maxTop(head); | 398 | unsigned int max_height = screen->maxBottom(head) - screen->maxTop(head); |
401 | 399 | ||
diff --git a/src/WorkspaceCmd.hh b/src/WorkspaceCmd.hh index d50c0bf..ad63d04 100644 --- a/src/WorkspaceCmd.hh +++ b/src/WorkspaceCmd.hh | |||
@@ -170,7 +170,10 @@ private: | |||
170 | /// arranges windows in current workspace to rows and columns | 170 | /// arranges windows in current workspace to rows and columns |
171 | class ArrangeWindowsCmd: public FbTk::Command<void> { | 171 | class ArrangeWindowsCmd: public FbTk::Command<void> { |
172 | public: | 172 | public: |
173 | ArrangeWindowsCmd(std::string &pat): m_pat(pat.c_str()) { } | ||
173 | void execute(); | 174 | void execute(); |
175 | private: | ||
176 | const ClientPattern m_pat; | ||
174 | }; | 177 | }; |
175 | 178 | ||
176 | class ShowDesktopCmd: public FbTk::Command<void> { | 179 | class ShowDesktopCmd: public FbTk::Command<void> { |