summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hergert <christian@hergert.me>2022-03-10 08:04:14 -0800
committerChristian Hergert <christian@hergert.me>2022-03-10 08:04:14 -0800
commit84014e3414b5eb35e16a2a993472bfd391fe7ee1 (patch)
tree97f5984ac5af436bff527d65aace47da68aaf0a2
parent4ced1c90f168571ab3c2e422b77ec22569c079d3 (diff)
downloadgtk+-84014e3414b5eb35e16a2a993472bfd391fe7ee1.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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index f6140deafa..168cdc4e67 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];
}