From 23b9f923985ea80e65e20ddff3a0969da7eae7ce Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Tue, 29 Jul 2025 16:05:35 -0500 Subject: [PATCH] surface-state: refactor weston_surface_commit Move some code around so we only have a single call to weston_surface_apply(). This will simplify having deferred state updates later. Signed-off-by: Derek Foreman --- libweston/surface-state.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libweston/surface-state.c b/libweston/surface-state.c index 477009c4f..18756ed84 100644 --- a/libweston/surface-state.c +++ b/libweston/surface-state.c @@ -518,20 +518,20 @@ enum weston_surface_status weston_surface_commit(struct weston_surface *surface) { struct weston_subsurface *sub = weston_surface_to_subsurface(surface); + struct weston_surface_state *state = &surface->pending; enum weston_surface_status status; if (sub) { weston_surface_state_merge_from(&sub->cached, - &surface->pending, + state, surface); if (sub->effectively_synchronized) return WESTON_SURFACE_CLEAN; - status = weston_surface_apply(sub->surface, &sub->cached); - } else { - status = weston_surface_apply(surface, &surface->pending); + state = &sub->cached; } + status = weston_surface_apply(surface, state); return status; }