all repos — fluxbox @ afb137c7881c622547de6a4d91fc5c18cfe4d4aa

custom fork of the fluxbox windowmanager

added SendToNextWorkspace and SendToPrevWorkspace, patch from Mathias Gumz
fluxgen fluxgen
commit

afb137c7881c622547de6a4d91fc5c18cfe4d4aa

parent

b566b0d970f9074835e4c2480aa740e34579edb1

3 files changed, 40 insertions(+), 3 deletions(-)

jump to
M src/CurrentWindowCmd.ccsrc/CurrentWindowCmd.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: CurrentWindowCmd.cc,v 1.8 2003/10/26 12:36:55 fluxgen Exp $ +// $Id: CurrentWindowCmd.cc,v 1.9 2004/02/20 19:40:31 fluxgen Exp $ #include "CurrentWindowCmd.hh"

@@ -45,6 +45,19 @@

void SendToWorkspaceCmd::real_execute() { if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces()) fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow()); +} + +void SendToNextWorkspaceCmd::real_execute() { + unsigned int workspace_num= + ( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) % + fbwindow().screen().getNumberOfWorkspaces(); + fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow()); +} + +void SendToPrevWorkspaceCmd::real_execute() { + int workspace_num= fbwindow().screen().currentWorkspaceID() - m_workspace_num; + if ( workspace_num < 0 ) workspace_num+= fbwindow().screen().getNumberOfWorkspaces(); + fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow()); } void WindowHelperCmd::execute() {
M src/CurrentWindowCmd.hhsrc/CurrentWindowCmd.hh

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: CurrentWindowCmd.hh,v 1.6 2003/10/25 22:11:22 fluxgen Exp $ +// $Id: CurrentWindowCmd.hh,v 1.7 2004/02/20 19:40:31 fluxgen Exp $ #ifndef CURRENTWINDOWCMD_HH #define CURRENTWINDOWCMD_HH

@@ -63,6 +63,24 @@

class SendToWorkspaceCmd: public WindowHelperCmd { public: explicit SendToWorkspaceCmd(int workspace_num):m_workspace_num(workspace_num) { } +protected: + void real_execute(); +private: + const int m_workspace_num; +}; + +class SendToNextWorkspaceCmd: public WindowHelperCmd { +public: + explicit SendToNextWorkspaceCmd(int workspace_num):m_workspace_num(workspace_num) { } +protected: + void real_execute(); +private: + const int m_workspace_num; +}; + +class SendToPrevWorkspaceCmd: public WindowHelperCmd { +public: + explicit SendToPrevWorkspaceCmd(int workspace_num):m_workspace_num(workspace_num) { } protected: void real_execute(); private:
M src/FbCommandFactory.ccsrc/FbCommandFactory.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommandFactory.cc,v 1.26 2004/01/21 14:11:42 fluxgen Exp $ +// $Id: FbCommandFactory.cc,v 1.27 2004/02/20 19:40:31 fluxgen Exp $ #include "FbCommandFactory.hh"

@@ -108,6 +108,8 @@ "rightworkspace",

"rootmenu", "saverc", "sendtoworkspace", + "sendtonextworkspace", + "sendtoprevworkspace", "setstyle", "setworkspacename", "setworkspacenamedialog",

@@ -235,6 +237,10 @@ else if (command == "toggledecor")

return new CurrentWindowCmd(&FluxboxWindow::toggleDecoration); else if (command == "sendtoworkspace") return new SendToWorkspaceCmd(atoi(arguments.c_str()) - 1); // make 1-indexed to user + else if (command == "sendtonextworkspace") + return new SendToNextWorkspaceCmd(atoi(arguments.c_str())); + else if (command == "sendtoprevworkspace") + return new SendToPrevWorkspaceCmd(atoi(arguments.c_str())); else if (command == "killwindow") return new KillWindowCmd(); else if (command == "nexttab")