summaryrefslogtreecommitdiff
path: root/recipes/gqview/gqview-2.1.5/gqview-motion-hint.patch
blob: 6904c04f85c87f5133c9e85da46114435052e6bb (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
42
43
44
45
46
47
48
Use motion hints for smooth panning of image on slow machines.
================================================================================
--- src/pixbuf-renderer.c
+++ src/pixbuf-renderer.c
@@ -2968,6 +2968,13 @@
 	PixbufRenderer *pr;
 	gint accel;
 
+	/* This is a hack, but work far the best, at least for single pointer systems.
+	 * See http://bugzilla.gnome.org/show_bug.cgi?id=587714 for more. */
+	gint x, y;
+	gdk_window_get_pointer (bevent->window, &x, &y, NULL);
+	bevent->x = x;
+	bevent->y = y;
+
 	pr = PIXBUF_RENDERER(widget);
 
 	if (pr->scroller_id != -1)
@@ -3003,6 +3010,11 @@
 	pr->drag_last_x = bevent->x;
 	pr->drag_last_y = bevent->y;
 
+	/* This is recommended by the GTK+ documentation, but does not work properly.
+	 * Use deprecated way until GTK+ gets a solution for correct motion hint handling:
+	 * http://bugzilla.gnome.org/show_bug.cgi?id=587714
+	 */
+	/* gdk_event_request_motions (bevent); */
 	return FALSE;
 }
 
@@ -3023,7 +3035,7 @@
 			pr->drag_last_y = bevent->y;
 			pr->drag_moved = 0;
 			gdk_pointer_grab(widget->window, FALSE,
-					 GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+					 GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK,
 					 NULL, NULL, bevent->time);
 			gtk_grab_add(widget);
 			break;
@@ -3119,7 +3131,7 @@
 	g_signal_connect(G_OBJECT(pr), "leave_notify_event",
 			 G_CALLBACK(pr_mouse_leave_cb), pr);
 
-	gtk_widget_set_events(GTK_WIDGET(pr), GDK_POINTER_MOTION_MASK |
+	gtk_widget_set_events(GTK_WIDGET(pr), GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
 					      GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK |
 					      GDK_LEAVE_NOTIFY_MASK);