[gtk/wip/chergert/for-main: 34/37] macos: short-circuit on NSEventPhaseMayBegin
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/for-main: 34/37] macos: short-circuit on NSEventPhaseMayBegin
- Date: Mon, 28 Feb 2022 19:06:00 +0000 (UTC)
commit 3fada27095baafffe42a76e0dcc0c839811fe6a5
Author: Christian Hergert <christian hergert me>
Date: Mon Feb 28 00:42:47 2022 -0800
macos: short-circuit on NSEventPhaseMayBegin
We only need to send a single event in this case, so just short-circuit
instead of trying to return an additional event.
gdk/macos/gdkmacosdisplay-translate.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/gdk/macos/gdkmacosdisplay-translate.c b/gdk/macos/gdkmacosdisplay-translate.c
index e261b8a4ae..e3fb03fea5 100644
--- a/gdk/macos/gdkmacosdisplay-translate.c
+++ b/gdk/macos/gdkmacosdisplay-translate.c
@@ -639,15 +639,12 @@ fill_scroll_event (GdkMacosDisplay *self,
* scrolling immediately stops.
*/
if (phase == NSEventPhaseMayBegin)
- {
- ret = gdk_scroll_event_new (GDK_SURFACE (surface),
- pointer,
- NULL,
- get_time_from_ns_event (nsevent),
- state,
- 0.0, 0.0, TRUE);
- _gdk_event_queue_append (GDK_DISPLAY (self), g_steal_pointer (&ret));
- }
+ return gdk_scroll_event_new (GDK_SURFACE (surface),
+ pointer,
+ NULL,
+ get_time_from_ns_event (nsevent),
+ state,
+ 0.0, 0.0, TRUE);
dx = [nsevent deltaX];
dy = [nsevent deltaY];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]