summaryrefslogtreecommitdiff
path: root/util/epist
diff options
context:
space:
mode:
authorScott Moynes <smoynes@nexus.carleton.ca>2002-08-21 01:50:01 +0000
committerScott Moynes <smoynes@nexus.carleton.ca>2002-08-21 01:50:01 +0000
commit9be80896ef4bc12bfd6a1d218b976c06482b6e2b (patch)
tree7f25d7d4eb968c7cfdc1b294eec2c5eab2e63ccd /util/epist
parent5c284ecc834a447a913d843dc45d1c6f8d3dc80b (diff)
changeWorkspaceHorz() now cycles
Diffstat (limited to 'util/epist')
-rw-r--r--util/epist/screen.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/util/epist/screen.cc b/util/epist/screen.cc
index 3b619e17..48eaaaf2 100644
--- a/util/epist/screen.cc
+++ b/util/epist/screen.cc
@@ -614,22 +614,30 @@ void screen::changeWorkspaceHorz(const int num) const {
assert(_managed);
const Config *conf = _epist->getConfig();
int width = conf->getNumberValue(Config::workspaceColumns);
-
+ int wnum;
+
if (width > _num_desktops || width <= 0)
return;
if (num < 0) {
if (_active_desktop % width != 0)
changeWorkspace(_active_desktop - 1);
- else
- changeWorkspace(_active_desktop + width - 1);
+ else {
+ wnum = _active_desktop + width - 1;
+ if (wnum >= _num_desktops)
+ wnum = _num_desktops - 1;
+ }
}
else {
- if (_active_desktop % width != width - 1)
- changeWorkspace(_active_desktop + 1);
+ if (_active_desktop % width != width - 1) {
+ wnum = _active_desktop + 1;
+ if (wnum >= _num_desktops)
+ wnum = _num_desktops / width * width;
+ }
else
- changeWorkspace(_active_desktop - width + 1);
+ wnum = _active_desktop - width + 1;
}
+ changeWorkspace(wnum);
}
void screen::grabKey(const KeyCode keyCode, const int modifierMask) const {