aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/WorkspaceCmd.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
index 79c002e..e7d92ee 100644
--- a/src/WorkspaceCmd.cc
+++ b/src/WorkspaceCmd.cc
@@ -177,8 +177,15 @@ JumpToWorkspaceCmd::JumpToWorkspaceCmd(int workspace_num):m_workspace_num(worksp
177 177
178void JumpToWorkspaceCmd::execute() { 178void JumpToWorkspaceCmd::execute() {
179 BScreen *screen = Fluxbox::instance()->mouseScreen(); 179 BScreen *screen = Fluxbox::instance()->mouseScreen();
180 if (screen != 0) 180 if (screen != 0) {
181 screen->changeWorkspaceID(m_workspace_num); 181 int num = screen->numberOfWorkspaces();
182 int actual = m_workspace_num;
183 // we need an extra +1, since it's subtracted in FbCommandFactory
184 if (actual < 0) actual += num+1;
185 if (actual < 0) actual = 0;
186 if (actual >= num) actual = num - 1;
187 screen->changeWorkspaceID(actual);
188 }
182} 189}
183 190
184 191