[weston,3/4] desktop-shell: do not lower_fullscreen_layer(s, NULL)

Submitted by Fabien Lahoudere on May 2, 2018, 8:21 a.m.

Details

Message ID 1525249318-4746-4-git-send-email-fabien.lahoudere@collabora.com
State Accepted
Commit 87860c20ee51ccaff97849eb1e483b4d52ac22bc
Headers show
Series "Handle several NULL output pointer" ( rev: 1 ) in Wayland

Not browsing as part of any series.

Commit Message

Fabien Lahoudere May 2, 2018, 8:21 a.m.
From: Pekka Paalanen <pekka.paalanen@collabora.co.uk>

In activate, do not call lower_fullscreen_layer() at all if the output
is NULL. It should not do anything in that case, per the existing
comment.

This is a tentative crash fix for a case where there are no enabled
weston_outputs at all.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
---
 desktop-shell/shell.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index e6ce20b..1edd37b 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -3735,7 +3735,8 @@  activate(struct desktop_shell *shell, struct weston_view *view,
 
 	/* Only demote fullscreen surfaces on the output of activated shsurf.
 	 * Leave fullscreen surfaces on unrelated outputs alone. */
-	lower_fullscreen_layer(shell, shsurf->output);
+	if (shsurf->output)
+		lower_fullscreen_layer(shell, shsurf->output);
 
 	weston_view_activate(view, seat, flags);