From 63c6fe11fb2aa4eb648dd31d34134279873670ae Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Thu, 16 Nov 2023 23:02:57 +0100 Subject: [PATCH] window-actor/wayland: Keep track of when the geometry needs to be synced The window actor can be mapped every frame, e.g. when it is dragged in the overview. This commit keeps track when the geometry changed and we didn't managed to sync the geometry yet and need to sync it at a later time. Part-of: --- src/compositor/meta-window-actor-wayland.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/compositor/meta-window-actor-wayland.c b/src/compositor/meta-window-actor-wayland.c index 3a97d5995..4c0517291 100644 --- a/src/compositor/meta-window-actor-wayland.c +++ b/src/compositor/meta-window-actor-wayland.c @@ -50,6 +50,7 @@ struct _MetaWindowActorWayland ClutterActor *background; MetaSurfaceContainerActorWayland *surface_container; gulong highest_scale_monitor_handler_id; + gboolean needs_sync; }; static void cullable_iface_init (MetaCullableInterface *iface); @@ -582,7 +583,7 @@ meta_window_actor_wayland_sync_geometry (MetaWindowActor *actor) { MetaWindowActorWayland *self = META_WINDOW_ACTOR_WAYLAND (actor); - do_sync_geometry (self); + self->needs_sync = !do_sync_geometry (self); } static void @@ -594,7 +595,11 @@ meta_window_actor_wayland_map (ClutterActor *actor) parent_class->map (actor); - do_sync_geometry (self); + if (self->needs_sync) + { + do_sync_geometry (self); + self->needs_sync = FALSE; + } } static void