Currently, when all outputs are gone (all views are gone), a surface
is unmapped and destroyed, even though the client is still running.

This utilizes the previously added code to remap the surface when a
new output gets attached.

Signed-off-by: Armin Krezović <krezovic.ar...@gmail.com>
---
 fullscreen-shell/fullscreen-shell.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/fullscreen-shell/fullscreen-shell.c 
b/fullscreen-shell/fullscreen-shell.c
index 71d609c..42b1662 100644
--- a/fullscreen-shell/fullscreen-shell.c
+++ b/fullscreen-shell/fullscreen-shell.c
@@ -262,11 +262,21 @@ fs_output_clear_pending(struct fs_output *fsout);
 static void
 fs_output_destroy(struct fs_output *fsout)
 {
-       fs_output_set_surface(fsout, NULL, 0, 0, 0);
        fs_output_clear_pending(fsout);
 
        wl_list_remove(&fsout->link);
 
+       if (fsout->view) {
+               weston_view_destroy(fsout->view);
+               fsout->view = NULL;
+       }
+
+       if (fsout->surface && wl_list_empty(&fsout->shell->output_list)) {
+               add_unmapped_surface(fsout->shell, fsout->surface,
+                                    fsout->method);
+               fsout->surface = NULL;
+       }
+
        if (fsout->output)
                wl_list_remove(&fsout->output_destroyed.link);
 }
-- 
2.9.2

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to