]> Dogcows Code - chaz/openbox/commitdiff
fix grip workspace cycling
authorDana Jansens <danakj@orodu.net>
Thu, 17 Apr 2003 07:20:08 +0000 (07:20 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 17 Apr 2003 07:20:08 +0000 (07:20 +0000)
openbox/action.c

index 1740d1b131fddd29d14bab4ab1feb9561288ca7f..ea6202e68fe24b84ff1c31ea8cab379b6ed76a63 100644 (file)
@@ -524,32 +524,48 @@ static guint translate_row_col(guint r, guint c)
     case Orientation_Horz:
         switch (screen_desktop_layout.start_corner) {
         case Corner_TopLeft:
-            return r * screen_desktop_layout.columns + c;
+            return r % screen_desktop_layout.rows *
+                screen_desktop_layout.columns +
+                c % screen_desktop_layout.columns;
         case Corner_BottomLeft:
-            return (screen_desktop_layout.rows - 1 - r) *
-                screen_desktop_layout.columns + c;
+            return (screen_desktop_layout.rows - 1 -
+                    r % screen_desktop_layout.rows) *
+                screen_desktop_layout.columns +
+                c % screen_desktop_layout.columns;
         case Corner_TopRight:
-            return r * screen_desktop_layout.columns +
-                (screen_desktop_layout.columns - 1 - c);
+            return r % screen_desktop_layout.rows *
+                screen_desktop_layout.columns +
+                (screen_desktop_layout.columns - 1 -
+                 c % screen_desktop_layout.columns);
         case Corner_BottomRight:
-            return (screen_desktop_layout.rows - 1 - r) *
+            return (screen_desktop_layout.rows - 1 -
+                    r % screen_desktop_layout.rows) *
                 screen_desktop_layout.columns +
-                (screen_desktop_layout.columns - 1 - c);
+                (screen_desktop_layout.columns - 1 -
+                 c % screen_desktop_layout.columns);
         }
     case Orientation_Vert:
         switch (screen_desktop_layout.start_corner) {
         case Corner_TopLeft:
-            return c * screen_desktop_layout.rows + r;
+            return c % screen_desktop_layout.columns *
+                screen_desktop_layout.rows +
+                r % screen_desktop_layout.rows;
         case Corner_BottomLeft:
-            return c * screen_desktop_layout.rows +
-                (screen_desktop_layout.rows - 1 - r);
+            return c % screen_desktop_layout.columns *
+                screen_desktop_layout.rows +
+                (screen_desktop_layout.rows - 1 -
+                 r % screen_desktop_layout.rows);
         case Corner_TopRight:
-            return (screen_desktop_layout.columns - 1 - c) *
-                screen_desktop_layout.rows + r;
+            return (screen_desktop_layout.columns - 1 -
+                    c % screen_desktop_layout.columns) *
+                screen_desktop_layout.rows +
+                r % screen_desktop_layout.rows;
         case Corner_BottomRight:
-            return (screen_desktop_layout.columns - 1 - c) *
+            return (screen_desktop_layout.columns - 1 -
+                    c % screen_desktop_layout.columns) *
                 screen_desktop_layout.rows +
-                (screen_desktop_layout.rows - 1 - r);
+                (screen_desktop_layout.rows - 1 -
+                 r % screen_desktop_layout.rows);
         }
     }
     g_assert_not_reached();
This page took 0.026887 seconds and 4 git commands to generate.