summaryrefslogtreecommitdiff
path: root/desktop-shell
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2018-05-02 10:21:58 +0200
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2018-05-24 17:20:04 +0300
commitc63acc4cb891e6b89f76ceddfda0a49cd8bda2bd (patch)
tree89e0e1aaa950790382055ecd29a8b0020d61fe3b /desktop-shell
parent87860c20ee51ccaff97849eb1e483b4d52ac22bc (diff)
desktop-shell: survive NULL output in shell_configure_fullscreen()
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@collabora.co.uk> Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com> Reviewed-by: Ian Ray <ian.ray@ge.com>
Diffstat (limited to 'desktop-shell')
-rw-r--r--desktop-shell/shell.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index fb2d5e85..42fc27c6 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -2176,6 +2176,13 @@ shell_configure_fullscreen(struct shell_surface *shsurf)
weston_layer_entry_insert(&shsurf->shell->fullscreen_layer.view_list,
&shsurf->view->layer_link);
+ if (!shsurf->fullscreen_output) {
+ /* If there is no output, there's not much we can do.
+ * Position the window somewhere, whatever. */
+ weston_view_set_position(shsurf->view, 0, 0);
+ return;
+ }
+
shell_ensure_fullscreen_black_view(shsurf);
surface_subsurfaces_boundingbox(surface, &surf_x, &surf_y,