diff options
author | Christian Hergert <christian@hergert.me> | 2022-03-10 08:04:14 -0800 |
---|---|---|
committer | Christian Hergert <chergert@redhat.com> | 2022-03-16 12:25:10 -0700 |
commit | f47e6dda785b2c83031bead9163517d6fe51e793 (patch) | |
tree | e071e9d03f19e2f1da646b6c2c7fe0470976e6e3 | |
parent | 5c2d9d6f19eaaa03ce9d45a72aded8f3e527ecd9 (diff) | |
download | gtk+-f47e6dda785b2c83031bead9163517d6fe51e793.tar.gz |
macos: make transient-for key window when hiding surface
This only handled the popover case before and not the transient-for case.
-rw-r--r-- | gdk/macos/gdkmacossurface.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c index 6c116ed817..449a3b35a5 100644 --- a/gdk/macos/gdkmacossurface.c +++ b/gdk/macos/gdkmacossurface.c @@ -219,10 +219,17 @@ gdk_macos_surface_hide (GdkSurface *surface) if (was_key) { + GdkSurface *parent; + + if (GDK_IS_TOPLEVEL (surface)) + parent = surface->transient_for; + else + parent = surface->parent; + /* Return key input to the parent window if necessary */ - if (surface->parent != NULL && GDK_SURFACE_IS_MAPPED (surface->parent)) + if (parent != NULL && GDK_SURFACE_IS_MAPPED (parent)) { - GdkMacosWindow *parentWindow = GDK_MACOS_SURFACE (surface->parent)->window; + GdkMacosWindow *parentWindow = GDK_MACOS_SURFACE (parent)->window; [parentWindow showAndMakeKey:YES]; } |