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

Manuel Bachmann manuel.bachmann at open.eurogiciel.org
Mon Mar 30 14:42:30 PDT 2015


From: Manuel Bachmann <manuel.bachmann at open.eurogiciel.org>

If a fullscreen surface was minimized, the shell would keep
its fullscreen mode activated, and only a black background
would be visible.

Signed-off-by: Manuel Bachmann <manuel.bachmann at open.eurogiciel.org>
---
 desktop-shell/shell.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

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
-- 
1.8.3.1



More information about the wayland-devel mailing list