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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3404>
This commit is contained in:
Sebastian Wick 2023-11-16 23:02:57 +01:00 committed by Marge Bot
parent 9e036bfd23
commit 63c6fe11fb

View File

@ -50,6 +50,7 @@ struct _MetaWindowActorWayland
ClutterActor *background; ClutterActor *background;
MetaSurfaceContainerActorWayland *surface_container; MetaSurfaceContainerActorWayland *surface_container;
gulong highest_scale_monitor_handler_id; gulong highest_scale_monitor_handler_id;
gboolean needs_sync;
}; };
static void cullable_iface_init (MetaCullableInterface *iface); 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); MetaWindowActorWayland *self = META_WINDOW_ACTOR_WAYLAND (actor);
do_sync_geometry (self); self->needs_sync = !do_sync_geometry (self);
} }
static void static void
@ -594,7 +595,11 @@ meta_window_actor_wayland_map (ClutterActor *actor)
parent_class->map (actor); parent_class->map (actor);
if (self->needs_sync)
{
do_sync_geometry (self); do_sync_geometry (self);
self->needs_sync = FALSE;
}
} }
static void static void