desktop-shell: Don't crash on when attemping to switch

Attempting to perform a switch on a surface (already) closed will trip
the assert in activate(), so check if we have a weston_desktop_surface
before trying to activate it.

Fixes #543

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2021-10-15 20:20:17 +03:00
parent b5dbb7a7ab
commit 5699dbaae7

View File

@ -4451,7 +4451,7 @@ switcher_destroy(struct switcher *switcher)
weston_surface_damage(view->surface);
}
if (switcher->current) {
if (switcher->current && get_shell_surface(switcher->current->surface)) {
activate(switcher->shell, switcher->current,
keyboard->seat,
WESTON_ACTIVATE_FLAG_CONFIGURE);