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.
This commit is contained in:
Christian Hergert 2022-03-02 19:59:15 -08:00 committed by Christian Hergert
parent 9dbd79f2d8
commit 60aceb984f

View File

@ -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