1From 04105af49099660b4ecdeedee5c4b40e8bc9ae04 Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Tue, 31 May 2022 12:32:18 +0800
4Subject: [PATCH 65/79] desktop-shell: Fix crash when activating destroyed
5 desktop surface
6
7Tested with Qt's Windows Flags Example, by switching between Popup and
8Tool repeatedly.
9
10Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
11---
12 desktop-shell/shell.c | 3 ++-
13 1 file changed, 2 insertions(+), 1 deletion(-)
14
15diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
16index f572f8f..0643418 100644
17--- a/desktop-shell/shell.c
18+++ b/desktop-shell/shell.c
19@@ -3811,7 +3811,8 @@ activate(struct desktop_shell *shell, struct weston_view *view,
20
21 	main_surface = weston_surface_get_main_surface(es);
22 	shsurf = get_shell_surface(main_surface);
23-	assert(shsurf);
24+	if (!shsurf)
25+		return;
26
27 	shsurf_child = get_last_child(shsurf);
28 	if (shsurf_child) {
29--
302.20.1
31
32