aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-05 05:51:08 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-05 05:51:08 (GMT)
commit9d71ad9c1477875001ecd19eb4cbbe1c4ba4eb40 (patch)
treeafa83f187ad1fff23c3bb6755d63875041675cdb /src
parent0bdf33c1e5147363670c1ca801bcc913ff05778f (diff)
downloadfluxbox_pavel-9d71ad9c1477875001ecd19eb4cbbe1c4ba4eb40.zip
fluxbox_pavel-9d71ad9c1477875001ecd19eb4cbbe1c4ba4eb40.tar.bz2
make ShowDesktop command toggle between showing desktop and windows
Diffstat (limited to 'src')
-rw-r--r--src/WorkspaceCmd.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
index 4bd9c7e..ef7d992 100644
--- a/src/WorkspaceCmd.cc
+++ b/src/WorkspaceCmd.cc
@@ -484,12 +484,27 @@ void ShowDesktopCmd::execute() {
484 if (screen == 0) 484 if (screen == 0)
485 return; 485 return;
486 486
487 unsigned int count = 0;
487 Workspace::Windows windows(screen->currentWorkspace()->windowList()); 488 Workspace::Windows windows(screen->currentWorkspace()->windowList());
488 Workspace::Windows::iterator it = windows.begin(), 489 Workspace::Windows::iterator it = windows.begin(),
489 it_end = windows.end(); 490 it_end = windows.end();
490 for (; it != it_end; ++it) { 491 for (; it != it_end; ++it) {
491 if ((*it)->getWindowType() != Focusable::TYPE_DESKTOP) 492 if ((*it)->getWindowType() != Focusable::TYPE_DESKTOP) {
492 (*it)->iconify(); 493 (*it)->iconify();
494 count++;
495 }
496 }
497
498 if (count == 0) {
499 BScreen::Icons icon_list = screen->iconList();
500 BScreen::Icons::iterator icon_it = icon_list.begin();
501 BScreen::Icons::iterator itend = icon_list.end();
502 unsigned int space = screen->currentWorkspaceID();
503
504 for (; icon_it != itend; ++icon_it) {
505 if ((*icon_it)->isStuck() || (*icon_it)->workspaceNumber() == space)
506 (*icon_it)->deiconify();
507 }
493 } 508 }
494} 509}
495 510