desktop-shell: Store pointers to special-surface views

We only have one of those per output, and we need to dig them out later,
so just store a direct pointer to them.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2023-07-12 12:14:28 +01:00 committed by Marius Vlad
parent 7f54341377
commit 36d04b0347
2 changed files with 6 additions and 0 deletions

View file

@ -2860,6 +2860,7 @@ handle_background_surface_destroy(struct wl_listener *listener, void *data)
wl_list_remove(&output->background_surface_listener.link);
output->background_surface = NULL;
output->background_view = NULL;
}
static void
@ -2908,6 +2909,7 @@ desktop_shell_set_background(struct wl_client *client,
surface->output->height);
sh_output->background_surface = surface;
sh_output->background_view = view;
sh_output->background_surface_listener.notify =
handle_background_surface_destroy;
@ -2965,6 +2967,7 @@ handle_panel_surface_destroy(struct wl_listener *listener, void *data)
wl_list_remove(&output->panel_surface_listener.link);
output->panel_surface = NULL;
output->panel_view = NULL;
}
@ -3015,6 +3018,7 @@ desktop_shell_set_panel(struct wl_client *client,
surface->output->height);
sh_output->panel_surface = surface;
sh_output->panel_view = view;
sh_output->panel_surface_listener.notify = handle_panel_surface_destroy;
wl_signal_add(&surface->destroy_signal, &sh_output->panel_surface_listener);

View file

@ -67,9 +67,11 @@ struct shell_output {
struct wl_list link;
struct weston_surface *panel_surface;
struct weston_view *panel_view;
struct wl_listener panel_surface_listener;
struct weston_surface *background_surface;
struct weston_view *background_view;
struct wl_listener background_surface_listener;
};