aboutsummaryrefslogtreecommitdiff
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
parent0bdf33c1e5147363670c1ca801bcc913ff05778f (diff)
downloadfluxbox_pavel-9d71ad9c1477875001ecd19eb4cbbe1c4ba4eb40.zip
fluxbox_pavel-9d71ad9c1477875001ecd19eb4cbbe1c4ba4eb40.tar.bz2
make ShowDesktop command toggle between showing desktop and windows
-rw-r--r--ChangeLog2
-rw-r--r--doc/asciidoc/fluxbox-keys.txt3
-rw-r--r--doc/fluxbox-keys.52
-rw-r--r--src/WorkspaceCmd.cc17
4 files changed, 21 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index dceceee..6a76aea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.1 2Changes for 1.1
3*08/08/05: 3*08/08/05:
4 * Make ShowDesktop command toggle between showing windows and desktop (Mark)
5 WorkspaceCmd.cc
4 * Created new `fluxbox-keys' man page (thanks Jim Ramsay) 6 * Created new `fluxbox-keys' man page (thanks Jim Ramsay)
5 doc/asciidoc/fluxbox-keys.txt 7 doc/asciidoc/fluxbox-keys.txt
6 * Make resize cursors consistent (thanks Dmitry E. Oboukhov) 8 * Make resize cursors consistent (thanks Dmitry E. Oboukhov)
diff --git a/doc/asciidoc/fluxbox-keys.txt b/doc/asciidoc/fluxbox-keys.txt
index d9228f7..197e175 100644
--- a/doc/asciidoc/fluxbox-keys.txt
+++ b/doc/asciidoc/fluxbox-keys.txt
@@ -349,7 +349,8 @@ doing so.
349 the 'pattern' arguments. 349 the 'pattern' arguments.
350 350
351*ShowDesktop*:: 351*ShowDesktop*::
352 Iconifies all windows. 352 Minimizes all windows on the current workspace. If they are already all
353 minimized, then it restores them.
353 354
354*Deiconify* 'mode' 'destination':: 355*Deiconify* 'mode' 'destination'::
355Deiconifies windows (or, restores from a minimized state). 356Deiconifies windows (or, restores from a minimized state).
diff --git a/doc/fluxbox-keys.5 b/doc/fluxbox-keys.5
index 2f8c7a1..01bbd05 100644
--- a/doc/fluxbox-keys.5
+++ b/doc/fluxbox-keys.5
@@ -460,7 +460,7 @@ arguments\.
460.PP 460.PP
461\fBShowDesktop\fR 461\fBShowDesktop\fR
462.RS 4 462.RS 4
463Iconifies all windows\. 463Minimizes all windows on the current workspace\. If they are already all minimized, then it restores them\.
464.RE 464.RE
465.PP 465.PP
466\fBDeiconify\fR \fImode\fR \fIdestination\fR 466\fBDeiconify\fR \fImode\fR \fIdestination\fR
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