]> Dogcows Code - chaz/openbox/blobdiff - openbox/moveresize.c
ANSI function declarations, ie () -> (void)
[chaz/openbox] / openbox / moveresize.c
index 55a42c7fc6915d6fd8c09ef0f83bc670c2d4ae68..bb17d4a04f3f7b0153820c16dfaf2e23352001d2 100644 (file)
@@ -55,6 +55,7 @@ static gint cur_x, cur_y, cur_w, cur_h;
 static guint button;
 static guint32 corner;
 static ObDirection edge_warp_dir = -1;
+static gboolean edge_warp_odd = FALSE;
 static ObDirection key_resize_edge = -1;
 #ifdef SYNC
 static gboolean waiting_for_sync;
@@ -76,7 +77,7 @@ static void client_dest(ObClient *client, gpointer data)
 
 void moveresize_startup(gboolean reconfig)
 {
-    popup = popup_new(FALSE);
+    popup = popup_new();
     popup_set_text_align(popup, RR_JUSTIFY_CENTER);
 
     if (!reconfig)
@@ -298,7 +299,7 @@ static void do_move(gboolean keyboard, gint keydist)
 }
 
 
-static void do_resize()
+static void do_resize(void)
 {
     gint x, y, w, h, lw, lh;
 
@@ -483,12 +484,15 @@ static gboolean edge_warp_delay_func(gpointer data)
 {
     guint d;
 
-    d = screen_find_desktop(screen_desktop, edge_warp_dir, TRUE, FALSE);
-    if (d != screen_desktop) screen_set_desktop(d, TRUE);
-
-    edge_warp_dir = -1;
+    /* only fire every second time. so it's fast the first time, but slower
+       after that */
+    if (edge_warp_odd) {
+        d = screen_find_desktop(screen_desktop, edge_warp_dir, TRUE, FALSE);
+        if (d != screen_desktop) screen_set_desktop(d, TRUE);
+    }
+    edge_warp_odd = !edge_warp_odd;
 
-    return FALSE; /* don't repeat */
+    return TRUE; /* do repeat ! */
 }
 
 static void do_edge_warp(gint x, gint y)
@@ -522,18 +526,19 @@ static void do_edge_warp(gint x, gint y)
     }
 
     if (dir != edge_warp_dir) {
-        if (dir == (ObDirection)-1)
-            cancel_edge_warp();
-        else
+        cancel_edge_warp();
+        if (dir != (ObDirection)-1) {
+            edge_warp_odd = TRUE; /* switch on the first timeout */
             ob_main_loop_timeout_add(ob_main_loop,
                                      config_mouse_screenedgetime * 1000,
                                      edge_warp_delay_func,
                                      NULL, NULL, NULL);
+        }
         edge_warp_dir = dir;
     }
 }
 
-static void cancel_edge_warp()
+static void cancel_edge_warp(void)
 {
     ob_main_loop_timeout_remove(ob_main_loop, edge_warp_delay_func);
 }
This page took 0.025319 seconds and 4 git commands to generate.