From 70bd45e8e1c4b91676f80099aa87d11eeb3bf7d1 Mon Sep 17 00:00:00 2001 From: mathias Date: Thu, 9 Mar 2006 19:38:18 +0000 Subject: enhanced :NextWindow / :PrevWindow to accept as parameter, patch from marcus obst --- ChangeLog | 4 ++++ src/FbCommandFactory.cc | 8 ++++---- src/WorkspaceCmd.cc | 4 ++-- src/WorkspaceCmd.hh | 6 ++++++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f062a8d..27d204b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ (Format: Year/Month/Day) Changes for 0.9.15: *06/03/09: + * Enhanced :NextWindow and :PrevWindow to accept a ,see + :RightWindow and :LeftWindow + (Thanks Marcus Obst, marcus dot obst at s2003 dot tu minus chemnitz dot de) + FbCommandFactory.cc WorkspaceCmd.hh WorkspaceCmd.cc * Bugfix for _net_wm_state_hidden (Thanks Mark) Ewmh.cc * Updated ko_KR translations (Thanks Jo Hyunseok) diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index f1637b9..aa091bb 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc @@ -350,10 +350,10 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, // // Workspace commands // - else if (command == "nextworkspace" && arguments.empty()) - return new NextWorkspaceCmd(); - else if (command == "prevworkspace" && arguments.empty()) - return new PrevWorkspaceCmd(); + else if (command == "nextworkspace") + return new NextWorkspaceCmd(atoi(arguments.c_str())); + else if (command == "prevworkspace") + return new PrevWorkspaceCmd(atoi(arguments.c_str())); else if (command == "rightworkspace") return new RightWorkspaceCmd(atoi(arguments.c_str())); else if (command == "leftworkspace") diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index 39b415b..e50913f 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc @@ -103,13 +103,13 @@ void DirFocusCmd::execute() { void NextWorkspaceCmd::execute() { BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen != 0) - screen->nextWorkspace(); + screen->nextWorkspace(m_option == 0 ? 1 : m_option); } void PrevWorkspaceCmd::execute() { BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen != 0) - screen->prevWorkspace(); + screen->prevWorkspace(m_option == 0 ? 1 : m_option); } void LeftWorkspaceCmd::execute() { diff --git a/src/WorkspaceCmd.hh b/src/WorkspaceCmd.hh index 7051fa0..786492d 100644 --- a/src/WorkspaceCmd.hh +++ b/src/WorkspaceCmd.hh @@ -55,12 +55,18 @@ private: class NextWorkspaceCmd: public FbTk::Command { public: + explicit NextWorkspaceCmd(int option):m_option(option) { } void execute(); +private: + const int m_option; }; class PrevWorkspaceCmd: public FbTk::Command { public: + explicit PrevWorkspaceCmd(int option):m_option(option) { } void execute(); +private: + const int m_option; }; class LeftWorkspaceCmd: public FbTk::Command { -- cgit v0.11.2