diff options
author | markt <markt> | 2007-07-07 04:54:34 (GMT) |
---|---|---|
committer | markt <markt> | 2007-07-07 04:54:34 (GMT) |
commit | b735d405f58ac226e025d6ef4dbd91a0129bb12e (patch) | |
tree | a69c7f72198d02a19c2a577e53102eb4d261c7b1 /src | |
parent | 18cd70f74999b85ea5d35fc95fad3fdf33f1831e (diff) | |
download | fluxbox-b735d405f58ac226e025d6ef4dbd91a0129bb12e.zip fluxbox-b735d405f58ac226e025d6ef4dbd91a0129bb12e.tar.bz2 |
allow negative indices in :Workspace <int>
Diffstat (limited to 'src')
-rw-r--r-- | src/WorkspaceCmd.cc | 11 |
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 | ||
104 | void JumpToWorkspaceCmd::execute() { | 104 | void 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 | ||