[gtk/wip/chergert/for-4-6: 46/56] macos: make transient-for key window when hiding surface
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/for-4-6: 46/56] macos: make transient-for key window when hiding surface
- Date: Wed, 16 Mar 2022 19:25:46 +0000 (UTC)
commit f47e6dda785b2c83031bead9163517d6fe51e793
Author: Christian Hergert <christian hergert me>
Date: Thu Mar 10 08:04:14 2022 -0800
macos: make transient-for key window when hiding surface
This only handled the popover case before and not the transient-for case.
gdk/macos/gdkmacossurface.c | 11 +++++++++--
1 file 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];
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]