macos: improve event filtering for foreign panels
authorChristian Hergert <christian@hergert.me>
Fri, 18 Feb 2022 11:39:00 +0000 (03:39 -0800)
committerChristian Hergert <christian@hergert.me>
Fri, 18 Feb 2022 11:39:52 +0000 (03:39 -0800)
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

index e62a157e50832fa13d87260824a16a126f07683b..8e3cd90b82610b4afe50c0a83d36b828474bd76e 100644 (file)
@@ -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