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 442ea485ca..cd376f64c3 100644 --- a/gdk/macos/gdkmacossurface.c +++ b/gdk/macos/gdkmacossurface.c @@ -1061,6 +1061,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; @@ -1129,6 +1134,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); }