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
This commit is contained in:
Christian Hergert 2022-02-25 23:22:05 -08:00
parent 03882ef8e5
commit 3a0077f65f

View File

@ -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;
g_assert (ret == NULL);
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);
}
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)