From: Christian Hergert Date: Thu, 3 Mar 2022 03:59:15 +0000 (-0800) Subject: macos: require input region to become key X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2~20^2~4^2~337^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=28607f082cb62e0edbcee51be96632599db9413c;p=gtk4.git 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. --- 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