diff options
author | Manuel Bachmann <manuel.bachmann@open.eurogiciel.org> | 2014-12-08 13:39:17 +0100 |
---|---|---|
committer | Manuel Bachmann <manuel.bachmann@open.eurogiciel.org> | 2014-12-08 13:39:17 +0100 |
commit | 611318baa4dd0a50f658c2117975067c331817a3 (patch) | |
tree | 0fd1c76b7afdfaea3e1f094f21f0fde14caf9850 | |
parent | af8dc5372108831758eb590dd48e8dfdef6722e7 (diff) | |
download | weston-611318baa4dd0a50f658c2117975067c331817a3.tar.gz weston-611318baa4dd0a50f658c2117975067c331817a3.tar.bz2 weston-611318baa4dd0a50f658c2117975067c331817a3.zip |
shell: fix various interactions with the minimized statesubmit/tizen_common/20141208.130526accepted/tizen/common/20141208.181539
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 <manuel.bachmann@open.eurogiciel.org>
Author: Nicolas Guyomard <nicolas.guyomard@open.eurogiciel.org>
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
-rw-r--r-- | desktop-shell/shell.c | 27 |
1 files changed, 26 insertions, 1 deletions
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; } |