summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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