summaryrefslogtreecommitdiff
path: root/packages/gtk+/gtk+-2.10.14/range-no-redraw.patch
blob: e3603d7700b080fb3b9a623b6c0e706a6beb7353 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Index: gtk/gtkrange.c
===================================================================
--- gtk/gtkrange.c	(revision 18523)
+++ gtk/gtkrange.c	(working copy)
@@ -99,6 +99,8 @@
 
   GtkSensitivityType lower_sensitivity;
   GtkSensitivityType upper_sensitivity;
+
+  guint motion_idle;
 };
 
 
@@ -1721,6 +1723,16 @@
                  &handled);
 }
 
+static gboolean
+update_slider_position_idle (GtkRange *range)
+{
+  update_slider_position (range, range->layout->mouse_x,range->layout->mouse_y); 
+
+  range->layout->motion_idle = 0;
+
+  return FALSE;
+}
+
 static void 
 stop_scrolling (GtkRange *range)
 {
@@ -1860,8 +1872,8 @@
   if (gtk_range_update_mouse_location (range))
     gtk_widget_queue_draw (widget);
 
-  if (range->layout->grab_location == MOUSE_SLIDER)
-    update_slider_position (range, x, y);
+  if (range->layout->grab_location == MOUSE_SLIDER && !range->layout->motion_idle)
+    range->layout->motion_idle = g_idle_add ((GSourceFunc)update_slider_position_idle, range);
 
   /* We handled the event if the mouse was in the range_rect */
   return range->layout->mouse_location != MOUSE_OUTSIDE;