summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorScott Moynes <smoynes@nexus.carleton.ca>2002-08-21 01:26:56 +0000
committerScott Moynes <smoynes@nexus.carleton.ca>2002-08-21 01:26:56 +0000
commitdfaa9c9f64e2efd13523286c81753c076320ff89 (patch)
tree0b9262c2df47f597686e903b7847b16ae2440071 /util
parentbd05f7ec58f3e1f5839c372ad4fb007a8d8866f5 (diff)
added cycling to the grid stuff
Diffstat (limited to 'util')
-rw-r--r--util/epist/screen.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/epist/screen.cc b/util/epist/screen.cc
index 0ec57dec..4a356357 100644
--- a/util/epist/screen.cc
+++ b/util/epist/screen.cc
@@ -588,15 +588,29 @@ void screen::changeWorkspaceVert(const int num) const {
if (width > _num_desktops || width <= 0)
return;
+ // a cookie to the person that makes this pretty
if (num < 0) {
int wnum = _active_desktop - width;
if (wnum >= 0)
changeWorkspace(wnum);
+ else {
+ wnum = _num_desktops/width * width + _active_desktop;
+ if (wnum >= _num_desktops)
+ wnum = _num_desktops - 1;
+ changeWorkspace(wnum);
+ }
}
else {
int wnum = _active_desktop + width;
if (wnum < _num_desktops)
changeWorkspace(wnum);
+ else {
+ wnum = (_active_desktop + width) % _num_desktops - 1;
+ if (wnum < 0)
+ wnum = 0;
+ changeWorkspace(wnum);
+ }
+
}
}