[gtk/wip/chergert/for-main: 1/3] macos: do not focus new window when resigning main
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/for-main: 1/3] macos: do not focus new window when resigning main
- Date: Wed, 9 Mar 2022 21:21:42 +0000 (UTC)
commit b390e1da4ffa41da97b6686545fd4d32f4c6d22b
Author: Christian Hergert <christian hergert me>
Date: Mon Mar 7 14:31:23 2022 -0800
macos: do not focus new window when resigning main
This can get in the way of how we track changes while events are actively
processing. Instead, we may want to delay this until the next main loop
idle and then check to see if we have a main window as the NSNotification
may have come in right after this.
gdk/macos/gdkmacosdisplay.c | 36 ------------------------------------
1 file changed, 36 deletions(-)
---
diff --git a/gdk/macos/gdkmacosdisplay.c b/gdk/macos/gdkmacosdisplay.c
index 798633f33a..bc58c2a6f3 100644
--- a/gdk/macos/gdkmacosdisplay.c
+++ b/gdk/macos/gdkmacosdisplay.c
@@ -491,8 +491,6 @@ void
_gdk_macos_display_surface_resigned_main (GdkMacosDisplay *self,
GdkMacosSurface *surface)
{
- GdkMacosSurface *new_surface = NULL;
-
g_return_if_fail (GDK_IS_MACOS_DISPLAY (self));
g_return_if_fail (GDK_IS_MACOS_SURFACE (surface));
@@ -500,40 +498,6 @@ _gdk_macos_display_surface_resigned_main (GdkMacosDisplay *self,
g_queue_unlink (&self->main_surfaces, &surface->main);
_gdk_macos_display_clear_sorting (self);
-
- if (GDK_SURFACE (surface)->transient_for &&
- gdk_surface_get_mapped (GDK_SURFACE (surface)->transient_for))
- {
- new_surface = GDK_MACOS_SURFACE (GDK_SURFACE (surface)->transient_for);
- }
- else
- {
- const GList *surfaces = _gdk_macos_display_get_surfaces (self);
-
- for (const GList *iter = surfaces; iter; iter = iter->next)
- {
- GdkMacosSurface *item = iter->data;
-
- g_assert (GDK_IS_MACOS_SURFACE (item));
-
- if (item == surface)
- continue;
-
- if (GDK_SURFACE_IS_MAPPED (GDK_SURFACE (item)))
- {
- new_surface = item;
- break;
- }
- }
- }
-
- if (new_surface != NULL)
- {
- NSWindow *nswindow = _gdk_macos_surface_get_native (new_surface);
- [nswindow makeKeyAndOrderFront:nswindow];
- }
-
- _gdk_macos_display_clear_sorting (self);
}
static GdkSurface *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]