[gtk/wip/chergert/for-4-6: 26/56] macos: add re-entrancy check when monitors change
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/for-4-6: 26/56] macos: add re-entrancy check when monitors change
- Date: Wed, 16 Mar 2022 19:25:45 +0000 (UTC)
commit 2e1e7e72651089163f17b5a39d796612aa0559d9
Author: Christian Hergert <christian hergert me>
Date: Wed Mar 2 00:32:50 2022 -0800
macos: add re-entrancy check when monitors change
gdk/macos/gdkmacossurface-private.h | 1 +
gdk/macos/gdkmacossurface.c | 7 +++++++
2 files changed, 8 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 42ff05385b..14cb3de015 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -1035,6 +1035,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;
@@ -1103,6 +1108,8 @@ _gdk_macos_surface_monitor_changed (GdkMacosSurface *self)
_gdk_macos_surface_configure (self);
gdk_surface_invalidate_rect (GDK_SURFACE (self), NULL);
+
+ self->in_change_monitor = FALSE;
_gdk_macos_surface_request_frame (self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]