make ShowDesktop command toggle between showing desktop and windows
Mark Tiefenbruck mark@fluxbox.org
4 files changed,
21 insertions(+),
3 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -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.txt
→
doc/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.5
→
doc/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.cc
→
src/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(); + } } }