all repos — fluxbox @ 9d71ad9c1477875001ecd19eb4cbbe1c4ba4eb40

custom fork of the fluxbox windowmanager

make ShowDesktop command toggle between showing desktop and windows
Mark Tiefenbruck mark@fluxbox.org
commit

9d71ad9c1477875001ecd19eb4cbbe1c4ba4eb40

parent

0bdf33c1e5147363670c1ca801bcc913ff05778f

4 files changed, 21 insertions(+), 3 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,8 @@

(Format: Year/Month/Day) Changes for 1.1 *08/08/05: + * Make ShowDesktop command toggle between showing windows and desktop (Mark) + WorkspaceCmd.cc * Created new `fluxbox-keys' man page (thanks Jim Ramsay) doc/asciidoc/fluxbox-keys.txt * Make resize cursors consistent (thanks Dmitry E. Oboukhov)
M doc/asciidoc/fluxbox-keys.txtdoc/asciidoc/fluxbox-keys.txt

@@ -349,7 +349,8 @@ overlap the least amount possible. See *CLIENT PATTERNS* for more about

the 'pattern' arguments. *ShowDesktop*:: - Iconifies all windows. + Minimizes all windows on the current workspace. If they are already all + minimized, then it restores them. *Deiconify* 'mode' 'destination':: Deiconifies windows (or, restores from a minimized state).
M doc/fluxbox-keys.5doc/fluxbox-keys.5

@@ -460,7 +460,7 @@ .RE

.PP \fBShowDesktop\fR .RS 4 -Iconifies all windows\. +Minimizes all windows on the current workspace\. If they are already all minimized, then it restores them\. .RE .PP \fBDeiconify\fR \fImode\fR \fIdestination\fR
M src/WorkspaceCmd.ccsrc/WorkspaceCmd.cc

@@ -484,12 +484,27 @@ BScreen *screen = Fluxbox::instance()->mouseScreen();

if (screen == 0) return; + unsigned int count = 0; Workspace::Windows windows(screen->currentWorkspace()->windowList()); Workspace::Windows::iterator it = windows.begin(), it_end = windows.end(); for (; it != it_end; ++it) { - if ((*it)->getWindowType() != Focusable::TYPE_DESKTOP) + if ((*it)->getWindowType() != Focusable::TYPE_DESKTOP) { (*it)->iconify(); + count++; + } + } + + if (count == 0) { + BScreen::Icons icon_list = screen->iconList(); + BScreen::Icons::iterator icon_it = icon_list.begin(); + BScreen::Icons::iterator itend = icon_list.end(); + unsigned int space = screen->currentWorkspaceID(); + + for (; icon_it != itend; ++icon_it) { + if ((*icon_it)->isStuck() || (*icon_it)->workspaceNumber() == space) + (*icon_it)->deiconify(); + } } }