diff options
author | markt <markt> | 2007-07-07 04:56:42 (GMT) |
---|---|---|
committer | markt <markt> | 2007-07-07 04:56:42 (GMT) |
commit | 393d48888f30684935d657923db445c1a77c8e38 (patch) | |
tree | 1059e8ead6e019ff95dbbb67020b80a79dc75b9a /src | |
parent | 0a316695e88299dfbcfa88c1f07786581e1cfb0f (diff) | |
download | fluxbox-393d48888f30684935d657923db445c1a77c8e38.zip fluxbox-393d48888f30684935d657923db445c1a77c8e38.tar.bz2 |
allow negative indices for :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 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 | ||
178 | void JumpToWorkspaceCmd::execute() { | 178 | void 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 | ||