From 28607f082cb62e0edbcee51be96632599db9413c Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 2 Mar 2022 19:59:15 -0800 Subject: [PATCH] macos: require input region to become key Some things cannot become key windows (like tooltips). We can use the input_region existence to determine if we should allow it as a key window. --- gdk/macos/GdkMacosWindow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdk/macos/GdkMacosWindow.c b/gdk/macos/GdkMacosWindow.c index 3ed60cb049..836ded78e8 100644 --- a/gdk/macos/GdkMacosWindow.c +++ b/gdk/macos/GdkMacosWindow.c @@ -253,7 +253,8 @@ typedef NSString *CALayerContentsGravity; -(BOOL)canBecomeKeyWindow { - return GDK_IS_TOPLEVEL (gdk_surface) || GDK_IS_POPUP (gdk_surface); + return GDK_IS_TOPLEVEL (gdk_surface) || + (GDK_IS_POPUP (gdk_surface) && GDK_SURFACE (gdk_surface)->input_region != NULL); } -(void)showAndMakeKey:(BOOL)makeKey