[gtk/wip/chergert/macos-fix-event-filter] macos: improve event filtering for foreign panels




commit db77204a52cb4449f7a7c9e3c3ac9cd806098b5e
Author: Christian Hergert <christian hergert me>
Date:   Fri Feb 18 03:39:00 2022 -0800

    macos: improve event filtering for foreign panels
    
    We might have panels with controls in them where the window is running in
    another process. The control could have a wrapper window which we would
    see from this process. This can happen with the GtkFileChooserNative, but
    any NSSavePanel in macOS 10.15+ is out of process (not just sandboxed
    applications).

 gdk/macos/gdkmacosdisplay-translate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/macos/gdkmacosdisplay-translate.c b/gdk/macos/gdkmacosdisplay-translate.c
index e62a157e50..8e3cd90b82 100644
--- a/gdk/macos/gdkmacosdisplay-translate.c
+++ b/gdk/macos/gdkmacosdisplay-translate.c
@@ -857,9 +857,9 @@ get_surface_from_ns_event (GdkMacosDisplay *self,
 
 find_under_pointer:
 
-  if (!surface)
+  if (surface == NULL && nswindow == NULL)
     {
-      /* Fallback used when no NSSurface set.  This happens e.g. when
+      /* Fallback used when no NSWindow set. This happens e.g. when
        * we allow motion events without a window set in gdk_event_translate()
        * that occur immediately after the main menu bar was clicked/used.
        * This fallback will not return coordinates contained in a window's


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