From 7bb3a7b969852071e9585fead6b471e097768fed Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Thu, 4 Dec 2025 19:09:20 +0200 Subject: [PATCH] shell-utils: Ensure committed_private is set This ensures (an unlikely) cases where get_label might be called and the callback itself would makes use committted_private to retrieve callback data. Just make sure to set it prior. Signed-off-by: Marius Vlad --- libweston/shell-utils/shell-utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libweston/shell-utils/shell-utils.c b/libweston/shell-utils/shell-utils.c index 23815c79e..806005b14 100644 --- a/libweston/shell-utils/shell-utils.c +++ b/libweston/shell-utils/shell-utils.c @@ -204,10 +204,13 @@ weston_shell_utils_curtain_create(struct weston_compositor *compositor, curtain->view = view; curtain->buffer_ref = buffer_ref; - weston_surface_set_label_func(surface, params->get_label); + /* the get_label callback might depend on committed_private, so set + * committed_private before setting the label_func so the callback is + * always safe. */ surface->committed = params->surface_committed; surface->committed_private = params->surface_private; + weston_surface_set_label_func(surface, params->get_label); weston_surface_attach_solid(surface, buffer_ref, params->width, params->height);