aboutsummaryrefslogtreecommitdiff
path: root/src/WorkspaceCmd.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-07-07 04:54:34 (GMT)
committermarkt <markt>2007-07-07 04:54:34 (GMT)
commitb735d405f58ac226e025d6ef4dbd91a0129bb12e (patch)
treea69c7f72198d02a19c2a577e53102eb4d261c7b1 /src/WorkspaceCmd.cc
parent18cd70f74999b85ea5d35fc95fad3fdf33f1831e (diff)
downloadfluxbox-b735d405f58ac226e025d6ef4dbd91a0129bb12e.zip
fluxbox-b735d405f58ac226e025d6ef4dbd91a0129bb12e.tar.bz2
allow negative indices in :Workspace <int>
Diffstat (limited to 'src/WorkspaceCmd.cc')
-rw-r--r--src/WorkspaceCmd.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
index b040fdd..9859dd6 100644
--- a/src/WorkspaceCmd.cc
+++ b/src/WorkspaceCmd.cc
@@ -103,8 +103,15 @@ JumpToWorkspaceCmd::JumpToWorkspaceCmd(int workspace_num):m_workspace_num(worksp
103 103
104void JumpToWorkspaceCmd::execute() { 104void JumpToWorkspaceCmd::execute() {
105 BScreen *screen = Fluxbox::instance()->mouseScreen(); 105 BScreen *screen = Fluxbox::instance()->mouseScreen();
106 if (screen != 0) 106 if (screen != 0) {
107 screen->changeWorkspaceID(m_workspace_num); 107 int num = screen->numberOfWorkspaces();
108 int actual = m_workspace_num;
109 // we need an extra +1, since it's subtracted in FbCommandFactory
110 if (actual < 0) actual += num+1;
111 if (actual < 0) actual = 0;
112 if (actual >= num) actual = num - 1;
113 screen->changeWorkspaceID(actual);
114 }
108} 115}
109 116
110 117