]> Dogcows Code - chaz/openbox/commitdiff
02:33 (@xor) omg yes
authorDana Jansens <danakj@orodu.net>
Thu, 17 Apr 2003 07:33:50 +0000 (07:33 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 17 Apr 2003 07:33:50 +0000 (07:33 +0000)
02:33 (@xor) grid workspace cycling of d3th

openbox/action.c

index ea6202e68fe24b84ff1c31ea8cab379b6ed76a63..41e174d98e65c7b939d17137ef7d23a0752356f5 100644 (file)
@@ -578,13 +578,13 @@ void action_next_desktop_column(union ActionData *data)
 
     cur_row_col(&r, &c);
     ++c;
+    if (c >= screen_desktop_layout.columns)
+        c = 0;
     d = translate_row_col(r, c);
     if (d >= screen_num_desktops) {
         if (!data->nextprevdesktop.wrap) return;
-        c = 0;
-    }
-    if (d >= screen_num_desktops)
         ++c;
+    }
     d = translate_row_col(r, c);
     if (d < screen_num_desktops)
         screen_set_desktop(d);
@@ -596,13 +596,13 @@ void action_previous_desktop_column(union ActionData *data)
 
     cur_row_col(&r, &c);
     --c;
+    if (c >= screen_desktop_layout.columns)
+        c = screen_desktop_layout.columns - 1;
     d = translate_row_col(r, c);
     if (d >= screen_num_desktops) {
         if (!data->nextprevdesktop.wrap) return;
-        c = screen_desktop_layout.columns - 1;
-    }
-    if (d >= screen_num_desktops)
         --c;
+    }
     d = translate_row_col(r, c);
     if (d < screen_num_desktops)
         screen_set_desktop(d);
@@ -614,13 +614,13 @@ void action_next_desktop_row(union ActionData *data)
 
     cur_row_col(&r, &c);
     ++r;
+    if (r >= screen_desktop_layout.rows)
+        r = 0;
     d = translate_row_col(r, c);
     if (d >= screen_num_desktops) {
         if (!data->nextprevdesktop.wrap) return;
-        r = 0;
-    }
-    if (d >= screen_num_desktops)
         ++r;
+    }
     d = translate_row_col(r, c);
     if (d < screen_num_desktops)
         screen_set_desktop(d);
@@ -632,13 +632,13 @@ void action_previous_desktop_row(union ActionData *data)
 
     cur_row_col(&r, &c);
     --r;
+    if (r >= screen_desktop_layout.rows)
+        r = screen_desktop_layout.rows - 1;
     d = translate_row_col(r, c);
     if (d >= screen_num_desktops) {
         if (!data->nextprevdesktop.wrap) return;
-        c = screen_desktop_layout.rows - 1;
-    }
-    if (d >= screen_num_desktops)
         --r;
+    }
     d = translate_row_col(r, c);
     if (d < screen_num_desktops)
         screen_set_desktop(d);
This page took 0.025641 seconds and 4 git commands to generate.