]> Dogcows Code - chaz/openbox/commitdiff
added cycling to the grid stuff
authorScott Moynes <smoynes@nexus.carleton.ca>
Wed, 21 Aug 2002 01:26:56 +0000 (01:26 +0000)
committerScott Moynes <smoynes@nexus.carleton.ca>
Wed, 21 Aug 2002 01:26:56 +0000 (01:26 +0000)
util/epist/screen.cc

index 0ec57decab51bd2eaf35c399082139a45065ae4a..4a35635740f95e717b04431a5f6b3f7933b07265 100644 (file)
@@ -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);
+    }
+     
   }
 }
 
This page took 0.021934 seconds and 4 git commands to generate.