aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-04-22 21:12:34 (GMT)
committerfluxgen <fluxgen>2004-04-22 21:12:34 (GMT)
commitc5fb252a6f75c6a07a90ea49623de259db2cbeb4 (patch)
tree8e276570a7284219a240cb0e704f22e16d7a6958 /src/FbCommands.cc
parent1b38322d99a855c567c4c6d74aaaf6295c149a7b (diff)
downloadfluxbox-c5fb252a6f75c6a07a90ea49623de259db2cbeb4.zip
fluxbox-c5fb252a6f75c6a07a90ea49623de259db2cbeb4.tar.bz2
deiconify cmd, patch from Mathias Gumz
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r--src/FbCommands.cc51
1 files changed, 50 insertions, 1 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index 99c8eca..e7d1986 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -19,13 +19,14 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbCommands.cc,v 1.23 2004/01/21 14:11:15 fluxgen Exp $ 22// $Id: FbCommands.cc,v 1.24 2004/04/22 21:12:32 fluxgen Exp $
23 23
24#include "FbCommands.hh" 24#include "FbCommands.hh"
25#include "fluxbox.hh" 25#include "fluxbox.hh"
26#include "Screen.hh" 26#include "Screen.hh"
27#include "CommandDialog.hh" 27#include "CommandDialog.hh"
28#include "Workspace.hh" 28#include "Workspace.hh"
29#include "Window.hh"
29#include "Keys.hh" 30#include "Keys.hh"
30 31
31#include "FbTk/Theme.hh" 32#include "FbTk/Theme.hh"
@@ -249,4 +250,52 @@ void BindKeyCmd::execute() {
249 } 250 }
250} 251}
251 252
253DeiconifyCmd::DeiconifyCmd(const Mode mode,
254 const Destination dest) : m_mode(mode), m_dest(dest) { }
255
256void DeiconifyCmd::execute() {
257 BScreen *screen = Fluxbox::instance()->mouseScreen();
258 if (screen == 0)
259 return;
260
261 BScreen::Icons::reverse_iterator it= screen->getIconList().rbegin();
262 BScreen::Icons::reverse_iterator itend= screen->getIconList().rend();
263 unsigned int workspace_num= screen->currentWorkspaceID();
264 unsigned int old_workspace_num;
265
266 const bool change_ws= m_dest == ORIGIN;
267
268 switch(m_mode) {
269
270 case ALL:
271 case ALLWORKSPACE:
272 for(; it != itend; it++) {
273 old_workspace_num= (*it)->workspaceNumber();
274 if (m_mode == ALL || old_workspace_num == workspace_num) {
275 if (m_dest == ORIGIN || m_dest == ORIGINQUIET)
276 screen->sendToWorkspace(old_workspace_num, (*it), change_ws);
277 else
278 (*it)->deiconify(false);
279 }
280 }
281 break;
282
283 case LAST:
284 case LASTWORKSPACE:
285 default:
286 for (; it != itend; it++) {
287 old_workspace_num= (*it)->workspaceNumber();
288 if(m_mode == LAST || old_workspace_num == workspace_num) {
289 if ((m_dest == ORIGIN || m_dest == ORIGINQUIET) &&
290 m_mode != LASTWORKSPACE)
291 screen->sendToWorkspace(old_workspace_num, (*it), change_ws);
292 else
293 (*it)->deiconify(false);
294 break;
295 }
296 }
297 break;
298 };
299}
300
252}; // end namespace FbCommands 301}; // end namespace FbCommands