summaryrefslogtreecommitdiff
path: root/openbox/screen.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-09 04:16:31 +0000
committerDana Jansens <danakj@orodu.net>2007-05-09 04:16:31 +0000
commite384e8a42e933fd75fcb57d6a575b9903e55ebde (patch)
treea53afc0c6f018247dba067147fc8538936a6776e /openbox/screen.c
parenta3f8c5c45a1ff323fc088cc5af49ab48d5679e54 (diff)
make cycling desktops not move when cancelling
Diffstat (limited to 'openbox/screen.c')
-rw-r--r--openbox/screen.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/openbox/screen.c b/openbox/screen.c
index dea9d020..7814dce4 100644
--- a/openbox/screen.c
+++ b/openbox/screen.c
@@ -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;
}