1From 63c8d9155deb77c798d6e5ada4ca046d98a516b6 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/93] 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 08c84c5..25d9525 100644 16--- a/desktop-shell/shell.c 17+++ b/desktop-shell/shell.c 18@@ -2631,6 +2631,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@@ -3947,6 +3951,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@@ -3962,6 +3968,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