From e3f0efa065d7263e26d5817aceb480e017ef6a75 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 10 Jan 2022 19:30:16 +0100 Subject: [PATCH] wayland/surface: Ensure to apply cached state It is possible that we never create a cached state for a surface even if it is synced. That is the case if `commit()` is never called. We still need to call `apply_state()` in this case in order to run e.g. `role_post_apply_state()` or `parent_state_applied` on subsurfaces. So just ensure to initialize the cached state instead of bailing out. Part-of: --- src/wayland/meta-wayland-surface.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 1032c4a78..780c62e02 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -969,9 +969,7 @@ cleanup: void meta_wayland_surface_apply_cached_state (MetaWaylandSurface *surface) { - if (!surface->cached_state) - return; - + meta_wayland_surface_ensure_cached_state (surface); meta_wayland_surface_apply_state (surface, surface->cached_state); }