[gtk/wip/chergert/quartz4u] macos: only allow toplevel to become key
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/quartz4u] macos: only allow toplevel to become key
- Date: Mon, 4 May 2020 19:28:01 +0000 (UTC)
commit 3ae8145135374da90ccf495c0b2a8339fc60412b
Author: Christian Hergert <chergert redhat com>
Date: Mon May 4 12:06:54 2020 -0700
macos: only allow toplevel to become key
I think we still wan thte toplevel to be the key window, and popups can receive events
from the toplevel (rather than being allowed to receive them directly).
gdk/macos/GdkMacosWindow.c | 39 +--------------------------------------
1 file changed, 1 insertion(+), 38 deletions(-)
---
diff --git a/gdk/macos/GdkMacosWindow.c b/gdk/macos/GdkMacosWindow.c
index ada747ee13..822149d56f 100644
--- a/gdk/macos/GdkMacosWindow.c
+++ b/gdk/macos/GdkMacosWindow.c
@@ -299,44 +299,7 @@
-(BOOL)canBecomeKeyWindow
{
-#if 0
- jdkSurface *window = [[self contentView] gdkSurface];
- GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
-
- if (!window->accept_focus)
- return NO;
-
- /* Popup windows should not be able to get focused in the window
- * manager sense, it's only handled through grabs.
- */
- if (window->surface_type == GDK_SURFACE_TEMP)
- return NO;
-
- switch (impl->type_hint)
- {
- case GDK_SURFACE_TYPE_HINT_NORMAL:
- case GDK_SURFACE_TYPE_HINT_DIALOG:
- case GDK_SURFACE_TYPE_HINT_MENU:
- case GDK_SURFACE_TYPE_HINT_TOOLBAR:
- case GDK_SURFACE_TYPE_HINT_UTILITY:
- case GDK_SURFACE_TYPE_HINT_DOCK:
- case GDK_SURFACE_TYPE_HINT_DESKTOP:
- case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU:
- case GDK_SURFACE_TYPE_HINT_POPUP_MENU:
- case GDK_SURFACE_TYPE_HINT_COMBO:
- return YES;
-
- case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN:
- case GDK_SURFACE_TYPE_HINT_TOOLTIP:
- case GDK_SURFACE_TYPE_HINT_NOTIFICATION:
- case GDK_SURFACE_TYPE_HINT_DND:
- return NO;
- }
-
- return YES;
-#endif
-
- return NO;
+ return GDK_IS_TOPLEVEL (gdkSurface);
}
-(void)showAndMakeKey:(BOOL)makeKey
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]