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>
dev
Marius Vlad 3 years ago
parent b5dbb7a7ab
commit 5699dbaae7
  1. 2
      desktop-shell/shell.c

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

Loading…
Cancel
Save