mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 12:32:05 +00:00
wayland/subsurface: Ensure cached state recursivly gets applied on set_desync()
Subsurfaces can be effectively synced indirectly via their ancestors. Right now such indirectly synced surfaces don't apply their cached state when their ancestor effectively becomes desync as by the time we call `parent_state_applied()` on them, they are considered as desync. Thus sligthly reoder things so when the ancestors becomes desync and applies its state, those surfaces still count as synced and will thus apply their cached state as well. While on it, add a check to prevent `set_desync()` to have side effects when the target surface is not currently synced. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2232>
This commit is contained in:
parent
68b6507429
commit
03434e566a
@ -468,14 +468,18 @@ wl_subsurface_set_desync (struct wl_client *client,
|
|||||||
struct wl_resource *resource)
|
struct wl_resource *resource)
|
||||||
{
|
{
|
||||||
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
|
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
|
||||||
gboolean was_effectively_synchronized;
|
gboolean is_parent_effectively_synchronized;
|
||||||
|
|
||||||
was_effectively_synchronized = is_surface_effectively_synchronized (surface);
|
if (!surface->sub.synchronous)
|
||||||
surface->sub.synchronous = FALSE;
|
return;
|
||||||
|
|
||||||
if (was_effectively_synchronized &&
|
is_parent_effectively_synchronized =
|
||||||
!is_surface_effectively_synchronized (surface))
|
is_surface_effectively_synchronized (surface->sub.parent);
|
||||||
|
|
||||||
|
if (!is_parent_effectively_synchronized)
|
||||||
meta_wayland_surface_apply_cached_state (surface);
|
meta_wayland_surface_apply_cached_state (surface);
|
||||||
|
|
||||||
|
surface->sub.synchronous = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct wl_subsurface_interface meta_wayland_wl_subsurface_interface = {
|
static const struct wl_subsurface_interface meta_wayland_wl_subsurface_interface = {
|
||||||
|
Loading…
Reference in New Issue
Block a user