[gtk/wip/chergert/quartz4u] macos: fix clicking on native titlebars



commit 60478771d6094bfaf1916d7ccedaec27e191c5bf
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 8 15:22:06 2020 -0700

    macos: fix clicking on native titlebars

 gdk/macos/gdkmacosdisplay-translate.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/gdk/macos/gdkmacosdisplay-translate.c b/gdk/macos/gdkmacosdisplay-translate.c
index ceea4621cf..a1e107ef03 100644
--- a/gdk/macos/gdkmacosdisplay-translate.c
+++ b/gdk/macos/gdkmacosdisplay-translate.c
@@ -207,6 +207,11 @@ fill_button_event (GdkMacosDisplay *display,
   g_assert (GDK_IS_MACOS_DISPLAY (display));
   g_assert (GDK_IS_MACOS_SURFACE (surface));
 
+  /* Ignore button events outside the window coords */
+  if (x < 0 || x > GDK_SURFACE (surface)->width ||
+      y < 0 || y > GDK_SURFACE (surface)->height)
+    return NULL;
+
   seat = gdk_display_get_default_seat (GDK_DISPLAY (display));
   state = get_keyboard_modifiers_from_ns_event (nsevent) |
          _gdk_macos_display_get_current_mouse_modifiers (display);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]