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 <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2025-12-04 19:09:20 +02:00 committed by Derek Foreman
parent 015d73cb54
commit 7bb3a7b969

View file

@ -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);