From 611318baa4dd0a50f658c2117975067c331817a3 Mon Sep 17 00:00:00 2001 From: Manuel Bachmann Date: Mon, 8 Dec 2014 13:39:17 +0100 Subject: shell: fix various interactions with the minimized state This fixes the following : - if a surface was set fullscreen, and then minimized, the fullscreen compositor state would stay on and display a black screen ; - if a surface was set fullscreen, and we would then cycle between surfaces (with Mod+Tab e.g.), the fullscreen compositor state would stay on, and the fullscreen layer would sometimes hide surfaces positioned behind it ; - style and functional polishing. Change-Id: Ieeec480d16769f27d2ed7a97eb943e0100efcd0b Bug-Tizen: TC-1349 Origin: http://lists.freedesktop.org/archives/wayland-devel/2014-July/016257.html Author: Manuel Bachmann Author: Nicolas Guyomard Signed-off-by: Manuel Bachmann --- desktop-shell/shell.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 8f7457f8..2ee9f518 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -2610,6 +2610,7 @@ set_minimized(struct weston_surface *surface, uint32_t is_true) struct weston_seat *seat; struct weston_surface *focus; struct weston_view *view; + float x, y; view = get_default_view(surface); if (!view) @@ -2623,6 +2624,17 @@ set_minimized(struct weston_surface *surface, uint32_t is_true) weston_layer_entry_remove(&view->layer_link); /* hide or show, depending on the state */ if (is_true) { + /* if the surface is fullscreen, unset the global fullscreen state, + * but keep the surface centered on its previous output. + */ + if (shsurf->state.fullscreen) { + x = shsurf->view->geometry.x; + y = shsurf->view->geometry.y; + unset_fullscreen(shsurf); + weston_view_set_position(shsurf->view, x, y); + } + + weston_layer_entry_remove(&view->layer_link); weston_layer_entry_insert(&shsurf->shell->minimized_layer.view_list, &view->layer_link); drop_focus_state(shsurf->shell, current_ws, view->surface); @@ -5770,11 +5782,23 @@ struct switcher { static void switcher_next(struct switcher *switcher) { + struct focus_state *state; + struct weston_surface *surface; struct weston_view *view; struct weston_surface *first = NULL, *prev = NULL, *next = NULL; struct shell_surface *shsurf; struct workspace *ws = get_current_workspace(switcher->shell); + /* if the focused surface is fullscreen, minimize it */ + wl_list_for_each(state, &ws->focus_list, link) { + if (state->keyboard_focus) { + surface = weston_surface_get_main_surface(state->keyboard_focus); + shsurf = get_shell_surface(surface); + if (shsurf->state.fullscreen) + set_minimized(surface, 1); + } + } + /* temporary re-display minimized surfaces */ struct weston_view *tmp; struct weston_view **minimized; @@ -5821,7 +5845,8 @@ switcher_next(struct switcher *switcher) view->alpha = 1.0; shsurf = get_shell_surface(switcher->current); - if (shsurf && shsurf->state.fullscreen) + if (shsurf && shsurf->state.fullscreen + && shsurf->fullscreen.black_view) shsurf->fullscreen.black_view->alpha = 1.0; } -- cgit v1.2.3