[PATCH][weston] desktop-shell: fix minimization of fullscreen surfaces

Manuel Bachmann manuel.bachmann at iot.bzh
Sun Sep 20 10:10:37 PDT 2015


Hi folks,

Any news on this one ? (https://patchwork.freedesktop.org/patch/46001/)

Just tried, the problem still shows in latest master (if you fullscreen
weston-terminal with [F11], and then minimize wih right-click ->
"Minimize", the screen stays black).

If the implementation not seeming optimal is the root cause, I really think
it is the best we can achieve with a few lines and while keeping the
existing model. I am totally open to suggestions, though.

---------------------------------
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index f7c928e..073f187 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -2667,6 +2667,11 @@  set_minimized(struct weston_surface *surface)
     weston_layer_entry_remove(&view->layer_link);
     weston_layer_entry_insert(&shsurf->shell->minimized_layer.view_list,
&view->layer_link);

+    /* if this surface if fullscreen, we temporarily disable fullscreen
+     * mode and reposition it to its previous x,y coordinates */
+    if (shsurf->state.fullscreen)
+        unset_fullscreen(shsurf);
+
     drop_focus_state(shsurf->shell, current_ws, view->surface);
     wl_list_for_each(seat, &shsurf->shell->compositor->seat_list, link) {
         if (!seat->keyboard)
@@ -6016,8 +6021,14 @@  switcher_next(struct switcher *switcher)
         view->alpha = 1.0;

     shsurf = get_shell_surface(switcher->current);
-    if (shsurf && shsurf->state.fullscreen)
-        shsurf->fullscreen.black_view->alpha = 1.0;
+    if (shsurf && shsurf->state.fullscreen) {
+        /* A fullscreen surface may not be centered anymore
+                 * if unset_fullscreen() was called on it, e.g.
+                 * when minimizing it. Make sure it is again. */
+        center_on_output(shsurf->view, shsurf->fullscreen_output);
+        if (shsurf->fullscreen.black_view)
+            shsurf->fullscreen.black_view->alpha = 1.0;
+    }
 }

 static void
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150920/40621be0/attachment-0001.html>


More information about the wayland-devel mailing list