[PATCH weston 4/4] desktop-shell: survive NULL output in shell_configure_fullscreen()

Fabien Lahoudere fabien.lahoudere at collabora.com
Wed May 2 08:21:58 UTC 2018

From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Running 'weston-simple-egl -f -b' (fullscreen, unthrottled) caused a
crash in shell_ensure_fullscreen_black_view() due to
shsurf->fullscreen_output being NULL. Also shell_configure_fullscreen()
could crash on that condition.

Fix shell_configure_fullscreen() to bail out with minimal work if there
is no fullscreen_output.

It is unclear if anything will cause a reconfiguration when an output is
plugged in.

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

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 1edd37b..b9fa42d 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -2152,6 +2152,13 @@ shell_configure_fullscreen(struct shell_surface *shsurf)
+	if (!shsurf->fullscreen_output) {
+		/* If there is no output, there's not much we can do.
+		 * Position the window somwhere, whatever. */
+		weston_view_set_position(shsurf->view, 0, 0);
+		return;
+	}
 	surface_subsurfaces_boundingbox(surface, &surf_x, &surf_y,

More information about the wayland-devel mailing list