From d5b5410b8f319af0db50ef62136f7da38090808d Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 13 Oct 2020 15:03:44 -0700 Subject: [PATCH] macos: use simple monotonic for event serial --- gdk/macos/gdkmacosdisplay-translate.c | 3 ++- gdk/macos/gdkmacosdisplay.c | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gdk/macos/gdkmacosdisplay-translate.c b/gdk/macos/gdkmacosdisplay-translate.c index 329f20b0dd..50497320f7 100644 --- a/gdk/macos/gdkmacosdisplay-translate.c +++ b/gdk/macos/gdkmacosdisplay-translate.c @@ -1179,7 +1179,8 @@ _gdk_macos_display_synthesize_motion (GdkMacosDisplay *self, y, NULL); node = _gdk_event_queue_append (GDK_DISPLAY (self), event); - _gdk_windowing_got_event (GDK_DISPLAY (self), node, event, 0); + _gdk_windowing_got_event (GDK_DISPLAY (self), node, event, + _gdk_display_get_next_serial (GDK_DISPLAY (self))); } void diff --git a/gdk/macos/gdkmacosdisplay.c b/gdk/macos/gdkmacosdisplay.c index 78af1cefce..6a89def8c1 100644 --- a/gdk/macos/gdkmacosdisplay.c +++ b/gdk/macos/gdkmacosdisplay.c @@ -380,7 +380,8 @@ gdk_macos_display_sync (GdkDisplay *display) static gulong gdk_macos_display_get_next_serial (GdkDisplay *display) { - return 0; + static gulong serial = 0; + return ++serial; } static gboolean @@ -437,7 +438,7 @@ gdk_macos_display_queue_events (GdkDisplay *display) _gdk_windowing_got_event (GDK_DISPLAY (self), _gdk_event_queue_append (GDK_DISPLAY (self), event), event, - 0); + _gdk_display_get_next_serial (GDK_DISPLAY (self))); } else { @@ -900,7 +901,8 @@ _gdk_macos_display_break_all_grabs (GdkMacosDisplay *self, grab->surface, TRUE); node = _gdk_event_queue_append (GDK_DISPLAY (self), event); - _gdk_windowing_got_event (GDK_DISPLAY (self), node, event, 0); + _gdk_windowing_got_event (GDK_DISPLAY (self), node, event, + _gdk_display_get_next_serial (GDK_DISPLAY (self))); } } }