mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 08:48:00 +02:00
desktop-shell: remove surface destroy listener when focus state is destroyed
Changing the focused surface did remove the surface_destroy_listener from the wl_signal list, but destroying the focus state did not. As a result, sometimes the same listener would be added to two surfaces, which would join their wl_signal lists together, which would cause infinite loops and use-after-frees when closing desktop surfaces.
This commit is contained in:
parent
ec3f779aa7
commit
15d3d3004b
1 changed files with 4 additions and 0 deletions
|
|
@ -663,6 +663,10 @@ focus_state_surface_destroy(struct wl_listener *listener, void *data)
|
|||
next = get_default_view(main_surface);
|
||||
|
||||
if (next) {
|
||||
if (state->keyboard_focus) {
|
||||
wl_list_remove(&state->surface_destroy_listener.link);
|
||||
wl_list_init(&state->surface_destroy_listener.link);
|
||||
}
|
||||
state->keyboard_focus = NULL;
|
||||
activate(state->shell, next, state->seat,
|
||||
WESTON_ACTIVATE_FLAG_CONFIGURE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue