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).