From: Christian Hergert Date: Fri, 18 Feb 2022 11:39:00 +0000 (-0800) Subject: macos: improve event filtering for foreign panels X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~3^2~77^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=db77204a52cb4449f7a7c9e3c3ac9cd806098b5e;p=gtk4.git 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). --- 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