[gtk/wip/chergert/for-main: 3/10] macos: avoid re-entrancy when changing monitors
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/for-main: 3/10] macos: avoid re-entrancy when changing monitors
- Date: Tue, 1 Mar 2022 07:09:57 +0000 (UTC)
commit 081079963b3069e265d22b402d9409ebd1fe197a
Author: Christian Hergert <christian hergert me>
Date: Mon Feb 28 18:16:36 2022 -0800
macos: avoid re-entrancy when changing monitors
gdk/macos/gdkmacossurface-private.h | 1 +
gdk/macos/gdkmacossurface.c | 6 ++++++
2 files changed, 7 insertions(+)
---
diff --git a/gdk/macos/gdkmacossurface-private.h b/gdk/macos/gdkmacossurface-private.h
index 15a7442c17..5f1f551f93 100644
--- a/gdk/macos/gdkmacossurface-private.h
+++ b/gdk/macos/gdkmacossurface-private.h
@@ -75,6 +75,7 @@ struct _GdkMacosSurface
guint geometry_dirty : 1;
guint next_frame_set : 1;
guint show_on_next_swap : 1;
+ guint in_change_monitor : 1;
guint in_frame : 1;
guint awaiting_frame : 1;
};
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index cb900a7328..233694449b 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -1068,6 +1068,11 @@ _gdk_macos_surface_monitor_changed (GdkMacosSurface *self)
g_return_if_fail (GDK_IS_MACOS_SURFACE (self));
+ if (self->in_change_monitor)
+ return;
+
+ self->in_change_monitor = TRUE;
+
_gdk_macos_surface_cancel_frame (self);
rect.x = self->root_x;
@@ -1134,6 +1139,7 @@ _gdk_macos_surface_monitor_changed (GdkMacosSurface *self)
gdk_monitor_get_connector (best)));
}
+ self->in_change_monitor = FALSE;
_gdk_macos_surface_configure (self);
gdk_surface_invalidate_rect (GDK_SURFACE (self), NULL);
_gdk_macos_surface_request_frame (self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]