[gtk/wip/chergert/for-main: 6/15] macos: remove emulated scroll events
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/for-main: 6/15] macos: remove emulated scroll events
- Date: Mon, 28 Feb 2022 19:38:03 +0000 (UTC)
commit 3a0077f65f28a9e7888471cf0485c80623c33a09
Author: Christian Hergert <christian hergert me>
Date: Fri Feb 25 23:22:05 2022 -0800
macos: remove emulated scroll events
We don't appear to actually need the emulated scroll events and they get
in the way of proper scrolling with the touchpad.
Fixes #4734
gdk/macos/gdkmacosdisplay-translate.c | 34 ++++++++++------------------------
1 file changed, 10 insertions(+), 24 deletions(-)
---
diff --git a/gdk/macos/gdkmacosdisplay-translate.c b/gdk/macos/gdkmacosdisplay-translate.c
index 646ba0cd9e..db1cfa2527 100644
--- a/gdk/macos/gdkmacosdisplay-translate.c
+++ b/gdk/macos/gdkmacosdisplay-translate.c
@@ -678,31 +678,17 @@ fill_scroll_event (GdkMacosDisplay *self,
dy = 0.0;
}
- if (dx != 0.0 || dy != 0.0)
+ if ((dx != 0.0 || dy != 0.0) && ![nsevent hasPreciseScrollingDeltas])
{
- if ([nsevent hasPreciseScrollingDeltas])
- {
- GdkEvent *emulated;
-
- emulated = gdk_scroll_event_new_discrete (GDK_SURFACE (surface),
- pointer,
- NULL,
- get_time_from_ns_event (nsevent),
- state,
- direction,
- TRUE);
- _gdk_event_queue_append (GDK_DISPLAY (self), emulated);
- }
- else
- {
- ret = gdk_scroll_event_new_discrete (GDK_SURFACE (surface),
- pointer,
- NULL,
- get_time_from_ns_event (nsevent),
- state,
- direction,
- FALSE);
- }
+ g_assert (ret == NULL);
+
+ ret = gdk_scroll_event_new_discrete (GDK_SURFACE (surface),
+ pointer,
+ NULL,
+ get_time_from_ns_event (nsevent),
+ state,
+ direction,
+ FALSE);
}
if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]