From 5699dbaae7df083e1f34ca88c37f21db669495b0 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 15 Oct 2021 20:20:17 +0300 Subject: [PATCH] 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 --- desktop-shell/shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 34a9ae4e2..7f84b6f3d 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -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);