summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moynes <smoynes@nexus.carleton.ca>2002-08-21 01:31:50 +0000
committerScott Moynes <smoynes@nexus.carleton.ca>2002-08-21 01:31:50 +0000
commit5c284ecc834a447a913d843dc45d1c6f8d3dc80b (patch)
tree50a8c317ea9c369c584c7f0b91c0446768cd4d94
parentdfaa9c9f64e2efd13523286c81753c076320ff89 (diff)
cleaned up changeWorkspaceVert() a bit
-rw-r--r--util/epist/screen.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/util/epist/screen.cc b/util/epist/screen.cc
index 4a356357..3b619e17 100644
--- a/util/epist/screen.cc
+++ b/util/epist/screen.cc
@@ -588,30 +588,26 @@ void screen::changeWorkspaceVert(const int num) const {
if (width > _num_desktops || width <= 0)
return;
+ int wnum;
+
// a cookie to the person that makes this pretty
if (num < 0) {
- int wnum = _active_desktop - width;
- if (wnum >= 0)
- changeWorkspace(wnum);
- else {
+ wnum = _active_desktop - width;
+ if (wnum < 0) {
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;
+ if (wnum >= _num_desktops) {
wnum = (_active_desktop + width) % _num_desktops - 1;
if (wnum < 0)
wnum = 0;
- changeWorkspace(wnum);
}
-
}
+ changeWorkspace(wnum);
}
void screen::changeWorkspaceHorz(const int num) const {