make ShowDesktop command toggle between showing desktop and windows

This commit is contained in:
Mark Tiefenbruck 2008-08-04 22:51:08 -07:00
parent 0bdf33c1e5
commit 9d71ad9c14
4 changed files with 21 additions and 3 deletions

View file

@ -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)

View file

@ -349,7 +349,8 @@ doing so.
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).

View file

@ -460,7 +460,7 @@ arguments\.
.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

View file

@ -484,12 +484,27 @@ void ShowDesktopCmd::execute() {
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();
}
}
}