summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-04-17 07:20:08 +0000
committerDana Jansens <danakj@orodu.net>2003-04-17 07:20:08 +0000
commit827e7baf20c3d0bb8251f5d024d304d0f9bebbe6 (patch)
tree07fff4ab6fc251a0eac24f796bb949189cb11cb7 /openbox
parentc4af950903820221bc8617de81231de32eef4f07 (diff)
fix grip workspace cycling
Diffstat (limited to 'openbox')
-rw-r--r--openbox/action.c44
1 files changed, 30 insertions, 14 deletions
diff --git a/openbox/action.c b/openbox/action.c
index 1740d1b1..ea6202e6 100644
--- a/openbox/action.c
+++ b/openbox/action.c
@@ -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();