]> Dogcows Code - chaz/openbox/commitdiff
make cycling desktops not move when cancelling
authorDana Jansens <danakj@orodu.net>
Wed, 9 May 2007 04:16:31 +0000 (04:16 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 9 May 2007 04:16:31 +0000 (04:16 +0000)
openbox/action.c
openbox/screen.c

index c106ead97b6c81a254a7e7ec74acd11569a844fc..4573a866d77cfea489f4004cc0b18aa28936a32e 100644 (file)
@@ -1531,9 +1531,7 @@ void action_desktop(union ActionData *data)
             if (data->inter.any.interactive)
                 screen_desktop_popup(data->desktop.desk, TRUE);
         }
-    }
-
-    if (!data->inter.any.interactive || data->inter.final)
+    } else
         screen_desktop_popup(0, FALSE);
 }
 
index dea9d020f66293b5bac3e4ea0330f1e0dd8ec19b..7814dce4f453fee0bef36081f8aad51cae08c258 100644 (file)
@@ -647,20 +647,12 @@ void screen_desktop_popup(guint d, gboolean show)
 guint screen_cycle_desktop(ObDirection dir, gboolean wrap, gboolean linear,
                            gboolean dialog, gboolean done, gboolean cancel)
 {
-    static gboolean first = TRUE;
-    static guint origd, d;
-    guint r, c;
-
-    if (cancel) {
-        d = origd;
-        goto done_cycle;
-    } else if (done && dialog) {
-        goto done_cycle;
-    }
-    if (first) {
-        first = FALSE;
-        d = origd = screen_desktop;
-    }
+    guint d, r, c;
+
+    d = screen_desktop;
+
+    if ((cancel || done) && dialog)
+        goto show_cycle_dialog;
 
     get_row_col(d, &r, &c);
 
@@ -773,16 +765,10 @@ guint screen_cycle_desktop(ObDirection dir, gboolean wrap, gboolean linear,
     }
 
 show_cycle_dialog:
-    if (dialog) {
+    if (dialog && !cancel && !done) {
         screen_desktop_popup(d, TRUE);
-        return d;
-    }
-
-done_cycle:
-    first = TRUE;
-
-    screen_desktop_popup(0, FALSE);
-
+    } else
+        screen_desktop_popup(0, FALSE);
     return d;
 }
 
This page took 0.027839 seconds and 4 git commands to generate.