1From e0cbe1a1e704639c40de2c82f1547b0b5a5d4052 Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Mon, 3 Oct 2022 21:03:04 +0800
4Subject: [PATCH 79/79] desktop-shell: Fix crash when hotplugging screens
5
61/ Force allowing respawn.
72/ Panel's output might not be available when committing.
8
9Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
10---
11 desktop-shell/shell.c | 7 +++++++
12 1 file changed, 7 insertions(+)
13
14diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
15index d4879b2..36a15d3 100644
16--- a/desktop-shell/shell.c
17+++ b/desktop-shell/shell.c
18@@ -3064,6 +3064,10 @@ panel_committed(struct weston_surface *es, int32_t sx, int32_t sy)
19
20 	view = container_of(es->views.next, struct weston_view, surface_link);
21
22+	/* The output might be unavaiable */
23+	if (!view->output)
24+		return;
25+
26 	get_panel_size(shell, view, &width, &height);
27 	switch (shell->panel_position) {
28 	case WESTON_DESKTOP_SHELL_PANEL_POSITION_TOP:
29@@ -4370,6 +4374,8 @@ check_desktop_shell_crash_too_early(struct desktop_shell *shell)
30 	if (clock_gettime(CLOCK_MONOTONIC, &now) < 0)
31 		return false;
32
33+	/* HACK: The shell might be crashed too early when hotplugging */
34+#if 0
35 	/*
36 	 * If the shell helper client dies before the session has been
37 	 * up for roughly 30 seconds, better just make Weston shut down,
38@@ -4385,6 +4391,7 @@ check_desktop_shell_crash_too_early(struct desktop_shell *shell)
39
40 		return true;
41 	}
42+#endif
43
44 	return false;
45 }
46--
472.20.1
48
49