From ca979aa219f83d11a12d87b2903eae9c2b93259c Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Tue, 12 Apr 2022 16:57:43 -0500 Subject: [PATCH] desktop-shell: Fix incorrect use of black_surface_get_label By some dark magic this accidentally doesn't crash because there are zeroes in the right places at startup, but black_surface_get_label() very much expects surface_private to be a view. Let's hand craft a new bespoke label function for this use. Signed-off-by: Derek Foreman --- desktop-shell/shell.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index ce8b18ec..0afd574d 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -3858,6 +3858,16 @@ shell_fade_done_for_output(struct weston_view_animation *animation, void *data) } } +static int +fade_surface_get_label(struct weston_surface *surface, + char *buf, size_t len) +{ + struct shell_output *output = surface->committed_private; + + return snprintf(buf, len, "desktop shell fade surface for %s", + output->output->name); +} + static struct weston_curtain * shell_fade_create_view_for_output(struct desktop_shell *shell, struct shell_output *shell_output) @@ -3869,7 +3879,7 @@ shell_fade_create_view_for_output(struct desktop_shell *shell, .x = output->x, .y = output->y, .width = output->width, .height = output->height, .surface_committed = black_surface_committed, - .get_label = black_surface_get_label, + .get_label = fade_surface_get_label, .surface_private = shell_output, .capture_input = false, };