linux-packaging-mono/external/bockbuild/packages/patches/gtk/0033-Never-intervene-in-the-event-stream-for-legacy-mice.patch
Xamarin Public Jenkins (auto-signing) 6bdd276d05 Imported Upstream version 5.0.0.42
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
2017-04-10 11:41:01 +00:00

40 lines
1.5 KiB
Diff

From 4eab270368617383e2e287c434f71e037e686047 Mon Sep 17 00:00:00 2001
From: Kristian Rietveld <kris@lanedo.com>
Date: Sun, 17 Feb 2013 13:06:59 +0100
Subject: [PATCH 33/68] Never intervene in the event stream for legacy mice
This is necessary for devices (e.g. Mighty Mouse) which do emit
precise deltas but no phase.
---
gdk/gdkwindow.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 7a3732c..2db0c0b 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -10849,12 +10849,20 @@ proxy_button_event (GdkEvent *source_event,
*/
if (type == GDK_SCROLL && source_event->scroll.has_deltas)
{
+ gboolean legacy_mouse =
+ source_event->scroll.phase == GDK_EVENT_SCROLL_PHASE_NONE &&
+ source_event->scroll.momentum_phase == GDK_EVENT_SCROLL_PHASE_NONE;
+
if (source_event->scroll.phase == GDK_EVENT_SCROLL_PHASE_START)
{
set_last_scroll_event_windows (display, pointer_window, event_win);
}
- else
+ else if (!legacy_mouse)
{
+ /* Never override pointer and event windows for legacy devices
+ * which are not capable of momentum scrolling. (The windows
+ * will be NULL, because they have never been set).
+ */
pointer_window = g_object_get_qdata (G_OBJECT (display),
quark_last_scroll_pointer_window);
event_win = g_object_get_qdata (G_OBJECT (display),
--
1.7.10.2 (Apple Git-33)