diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/FbCommandFactory.cc | 3 | ||||
-rw-r--r-- | src/WorkspaceCmd.cc | 21 | ||||
-rw-r--r-- | src/WorkspaceCmd.hh | 6 |
4 files changed, 35 insertions, 0 deletions
@@ -1,6 +1,11 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 0.9.16: | 2 | Changes for 0.9.16: |
3 | *06/04/16: | 3 | *06/04/16: |
4 | * Add "CloseAllWindows" key binding | ||
5 | (thanks Adriano Dal Bosco - adbosco at users.sourceforge.net) | ||
6 | - Useful to trigger all "close" actions before flux exit (or other) | ||
7 | to catch any pending file saves etc... | ||
8 | WorkspaceCmd.hh/cc FbCommandFactory.cc | ||
4 | * Fix all warnings with (gcc 3.4.6) -Wall, mainly sign comparisons (Simon) | 9 | * Fix all warnings with (gcc 3.4.6) -Wall, mainly sign comparisons (Simon) |
5 | ClientPattern.cc Container.cc FbWinFrame.cc IconButton.cc IconbarTool.cc | 10 | ClientPattern.cc Container.cc FbWinFrame.cc IconButton.cc IconbarTool.cc |
6 | ScreenPlacement.hh ScreenResources.cc ToolFactory.cc Toolbar.cc | 11 | ScreenPlacement.hh ScreenResources.cc ToolFactory.cc Toolbar.cc |
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index 4bf1dd5..a749684 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc | |||
@@ -51,6 +51,7 @@ FbCommandFactory::FbCommandFactory() { | |||
51 | "arrangewindows", | 51 | "arrangewindows", |
52 | "bindkey", | 52 | "bindkey", |
53 | "close", | 53 | "close", |
54 | "closeallwindows", | ||
54 | "commanddialog", | 55 | "commanddialog", |
55 | "deiconify", | 56 | "deiconify", |
56 | "detachclient", | 57 | "detachclient", |
@@ -310,6 +311,8 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, | |||
310 | return new CurrentWindowCmd(&FluxboxWindow::lowerLayer); | 311 | return new CurrentWindowCmd(&FluxboxWindow::lowerLayer); |
311 | else if (command == "close") | 312 | else if (command == "close") |
312 | return new CurrentWindowCmd(&FluxboxWindow::close); | 313 | return new CurrentWindowCmd(&FluxboxWindow::close); |
314 | else if (command == "closeallwindows") | ||
315 | return new CloseAllWindowsCmd(); | ||
313 | else if (command == "shade" || command == "shadewindow") | 316 | else if (command == "shade" || command == "shadewindow") |
314 | return new CurrentWindowCmd(&FluxboxWindow::shade); | 317 | return new CurrentWindowCmd(&FluxboxWindow::shade); |
315 | else if (command == "stick" || command == "stickwindow") | 318 | else if (command == "stick" || command == "stickwindow") |
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index 3673e17..9951e0e 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc | |||
@@ -238,3 +238,24 @@ void ShowDesktopCmd::execute() { | |||
238 | windows.end(), | 238 | windows.end(), |
239 | std::mem_fun(&FluxboxWindow::iconify)); | 239 | std::mem_fun(&FluxboxWindow::iconify)); |
240 | } | 240 | } |
241 | |||
242 | void CloseAllWindowsCmd::execute() { | ||
243 | BScreen *screen = Fluxbox::instance()->mouseScreen(); | ||
244 | if (screen == 0) | ||
245 | return; | ||
246 | |||
247 | BScreen::Workspaces::iterator workspace_it = screen->getWorkspacesList().begin(); | ||
248 | BScreen::Workspaces::iterator workspace_it_end = screen->getWorkspacesList().end(); | ||
249 | for (; workspace_it != workspace_it_end; ++workspace_it) { | ||
250 | Workspace::Windows windows((*workspace_it)->windowList()); | ||
251 | std::for_each(windows.begin(), | ||
252 | windows.end(), | ||
253 | std::mem_fun(&FluxboxWindow::close)); | ||
254 | } | ||
255 | BScreen::Icons::iterator icon_it = screen->iconList().begin(); | ||
256 | BScreen::Icons::iterator icon_it_end = screen->iconList().end(); | ||
257 | for (; icon_it != icon_it_end; ++icon_it ) { | ||
258 | (*icon_it)->close(); | ||
259 | } | ||
260 | |||
261 | } | ||
diff --git a/src/WorkspaceCmd.hh b/src/WorkspaceCmd.hh index 786492d..1e5b04d 100644 --- a/src/WorkspaceCmd.hh +++ b/src/WorkspaceCmd.hh | |||
@@ -104,4 +104,10 @@ public: | |||
104 | void execute(); | 104 | void execute(); |
105 | }; | 105 | }; |
106 | 106 | ||
107 | |||
108 | class CloseAllWindowsCmd: public FbTk::Command { | ||
109 | public: | ||
110 | void execute(); | ||
111 | }; | ||
112 | |||
107 | #endif // WORKSPACECMD_HH | 113 | #endif // WORKSPACECMD_HH |