mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-09 03:38:03 +02:00
window: destroy outputs on display_destroy()
This will also start calling the output destroy handlers, if an application has set any. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
parent
5ec6585753
commit
2c1426a72f
1 changed files with 23 additions and 0 deletions
|
|
@ -2232,6 +2232,17 @@ display_add_output(struct display *d, uint32_t id)
|
|||
wl_output_add_listener(output->output, &output_listener, output);
|
||||
}
|
||||
|
||||
static void
|
||||
output_destroy(struct output *output)
|
||||
{
|
||||
if (output->destroy_handler)
|
||||
(*output->destroy_handler)(output, output->user_data);
|
||||
|
||||
wl_output_destroy(output->output);
|
||||
wl_list_remove(&output->link);
|
||||
free(output);
|
||||
}
|
||||
|
||||
void
|
||||
display_set_output_configure_handler(struct display *display,
|
||||
display_output_handler_t handler)
|
||||
|
|
@ -2583,9 +2594,21 @@ display_create(int *argc, char **argv[], const GOptionEntry *option_entries)
|
|||
return d;
|
||||
}
|
||||
|
||||
static void
|
||||
display_destroy_outputs(struct display *display)
|
||||
{
|
||||
struct output *tmp;
|
||||
struct output *output;
|
||||
|
||||
wl_list_for_each_safe(output, tmp, &display->output_list, link)
|
||||
output_destroy(output);
|
||||
}
|
||||
|
||||
void
|
||||
display_destroy(struct display *display)
|
||||
{
|
||||
display_destroy_outputs(display);
|
||||
|
||||
fini_xkb(display);
|
||||
fini_egl(display);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue