<div dir="ltr"><div><div><div>Hi Giulio,<br><br>Sorry for the late answer, I happen to be very busy lately.<br><br>> How do you test that? Did you have to craft an ad-hoc client?<br><br></div>Yes ; you will find the client I use at this URL : <a href="http://www.tarnyko.net/repo/wayland-9b-xdg_shell_150.zip">http://www.tarnyko.net/repo/wayland-9b-xdg_shell_150.zip</a> (run "./build.sh" to compile).<br>If you then start the client, go fullscreen with the last upper-right square (black) and then minimize with the upper-left square (light gray), you will notice the client disappears and screen goes totally black. The patch fixes that (in a good manner, hopefully).<br><br>> There seems to be a bug still. If I mod+tab away from a fullscreen client into a windowed one and release the mod key, then pressing<br>
mod+tab again doesn't go back to the fullscreen client, i have to
press tab two times.<br><br></div>Oops ; I definitely have to try this. Thanks for letting me know !<br><br></div>Regards,<br>Manuel<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-09-03 20:45 GMT+02:00 Giulio Camuffo <span dir="ltr"><<a href="mailto:giuliocamuffo@gmail.com" target="_blank">giuliocamuffo@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2014-07-31 16:36 GMT+03:00 Manuel Bachmann<br>
<<a href="mailto:manuel.bachmann@open.eurogiciel.org">manuel.bachmann@open.eurogiciel.org</a>>:<br>
<span class="">> This fixes the following :<br>
> - if a surface was set fullscreen, and then minimized,<br>
> the fullscreen compositor state would stay on and display<br>
> a black screen ;<br>
<br>
</span>How do you test that? Did you have to craft an ad-hoc client?<br>
<span class=""><br>
> - if a surface was set fullscreen, and we would then<br>
> cycle between surfaces (with Mod+Tab e.g.), the fullscreen<br>
> compositor state would stay on, and the fullscreen layer<br>
> would sometimes hide surfaces positioned behind it ;<br>
<br>
</span>There seems to be a bug still. If I mod+tab away from a fullscreen<br>
client into a windowed one and release the mod key, then pressing<br>
mod+tab again doesn't go back to the fullscreen client, i have to<br>
press tab two times.<br>
<span class=""><br>
> - style and functional polishing, remove dead code.<br>
<br>
</span>The rest looks good to me.<br>
<br>
<br>
--<br>
Giulio<br>
<div><div class="h5"><br>
<br>
><br>
> Signed-off-by: Manuel Bachmann <<a href="mailto:manuel.bachmann@open.eurogiciel.org">manuel.bachmann@open.eurogiciel.org</a>><br>
> ---<br>
> desktop-shell/shell.c | 67 ++++++++++++++++++++++++++++---------------------<br>
> 1 file changed, 38 insertions(+), 29 deletions(-)<br>
><br>
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c<br>
> index 3c3649c..60639cc 100644<br>
> --- a/desktop-shell/shell.c<br>
> +++ b/desktop-shell/shell.c<br>
> @@ -2510,13 +2510,14 @@ unset_maximized(struct shell_surface *shsurf)<br>
> }<br>
><br>
> static void<br>
> -set_minimized(struct weston_surface *surface, uint32_t is_true)<br>
> +set_minimized(struct weston_surface *surface)<br>
> {<br>
> + struct weston_view *view;<br>
> struct shell_surface *shsurf;<br>
> - struct workspace *current_ws;<br>
> + struct workspace *ws;<br>
> struct weston_seat *seat;<br>
> struct weston_surface *focus;<br>
> - struct weston_view *view;<br>
> + float x,y;<br>
><br>
> view = get_default_view(surface);<br>
> if (!view)<br>
> @@ -2525,34 +2526,31 @@ set_minimized(struct weston_surface *surface, uint32_t is_true)<br>
> assert(weston_surface_get_main_surface(view->surface) == view->surface);<br>
><br>
> shsurf = get_shell_surface(surface);<br>
> - current_ws = get_current_workspace(shsurf->shell);<br>
> + ws = get_current_workspace(shsurf->shell);<br>
><br>
> - weston_layer_entry_remove(&view->layer_link);<br>
> - /* hide or show, depending on the state */<br>
> - if (is_true) {<br>
> - weston_layer_entry_insert(&shsurf->shell->minimized_layer.view_list, &view->layer_link);<br>
> -<br>
> - drop_focus_state(shsurf->shell, current_ws, view->surface);<br>
> - wl_list_for_each(seat, &shsurf->shell->compositor->seat_list, link) {<br>
> - if (!seat->keyboard)<br>
> - continue;<br>
> - focus = weston_surface_get_main_surface(seat->keyboard->focus);<br>
> - if (focus == view->surface)<br>
> - weston_keyboard_set_focus(seat->keyboard, NULL);<br>
> - }<br>
> + /* if the surface is fullscreen, unset the global fullscreen state,<br>
> + * but keep the surface centered on its previous output.<br>
> + */<br>
> + if (shsurf->state.fullscreen) {<br>
> + x = shsurf->view->geometry.x;<br>
> + y = shsurf->view->geometry.y;<br>
> + unset_fullscreen(shsurf);<br>
> + weston_view_set_position(shsurf->view, x, y);<br>
> }<br>
> - else {<br>
> - weston_layer_entry_insert(¤t_ws->layer.view_list, &view->layer_link);<br>
><br>
> - wl_list_for_each(seat, &shsurf->shell->compositor->seat_list, link) {<br>
> - if (!seat->keyboard)<br>
> - continue;<br>
> - activate(shsurf->shell, view->surface, seat, true);<br>
> - }<br>
> + weston_layer_entry_remove(&view->layer_link);<br>
> + weston_layer_entry_insert(&shsurf->shell->minimized_layer.view_list, &view->layer_link);<br>
> +<br>
> + drop_focus_state(shsurf->shell, ws, view->surface);<br>
> + wl_list_for_each(seat, &shsurf->shell->compositor->seat_list, link) {<br>
> + if (!seat->keyboard)<br>
> + continue;<br>
> + focus = weston_surface_get_main_surface(seat->keyboard->focus);<br>
> + if (focus == view->surface)<br>
> + weston_keyboard_set_focus(seat->keyboard, NULL);<br>
> }<br>
><br>
> shell_surface_update_child_surface_layers(shsurf);<br>
> -<br>
> weston_view_damage_below(view);<br>
> }<br>
><br>
> @@ -3534,8 +3532,7 @@ xdg_surface_set_minimized(struct wl_client *client,<br>
> if (shsurf->type != SHELL_SURFACE_TOPLEVEL)<br>
> return;<br>
><br>
> - /* apply compositor's own minimization logic (hide) */<br>
> - set_minimized(shsurf->surface, 1);<br>
> + set_minimized(shsurf->surface);<br>
> }<br>
><br>
> static const struct xdg_surface_interface xdg_surface_implementation = {<br>
> @@ -5444,12 +5441,24 @@ struct switcher {<br>
> static void<br>
> switcher_next(struct switcher *switcher)<br>
> {<br>
> + struct focus_state *state;<br>
> + struct weston_surface *surface;<br>
> struct weston_view *view;<br>
> struct weston_surface *first = NULL, *prev = NULL, *next = NULL;<br>
> struct shell_surface *shsurf;<br>
> struct workspace *ws = get_current_workspace(switcher->shell);<br>
><br>
> - /* temporary re-display minimized surfaces */<br>
> + /* if the focused surface is fullscreen, minimize it */<br>
> + wl_list_for_each(state, &ws->focus_list, link) {<br>
> + if (state->keyboard_focus) {<br>
> + surface = weston_surface_get_main_surface(state->keyboard_focus);<br>
> + shsurf = get_shell_surface(surface);<br>
> + if (shsurf->state.fullscreen)<br>
> + set_minimized(surface);<br>
> + }<br>
> + }<br>
> +<br>
> + /* temporarily display minimized surfaces again */<br>
> struct weston_view *tmp;<br>
> struct weston_view **minimized;<br>
> wl_list_for_each_safe(view, tmp, &switcher->shell->minimized_layer.view_list.link, layer_link.link) {<br>
> @@ -5495,7 +5504,7 @@ switcher_next(struct switcher *switcher)<br>
> view->alpha = 1.0;<br>
><br>
> shsurf = get_shell_surface(switcher->current);<br>
> - if (shsurf && shsurf->state.fullscreen)<br>
> + if (shsurf && shsurf->state.fullscreen && shsurf->fullscreen.black_view)<br>
> shsurf->fullscreen.black_view->alpha = 1.0;<br>
> }<br>
><br>
> --<br>
> 1.7.10.4<br>
><br>
</div></div>> _______________________________________________<br>
> wayland-devel mailing list<br>
> <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><font>Regards,<br>
<br>
<i><b>Manuel BACHMANN</b><br>
Tizen Project<br>
VANNES-FR</i><br>
</font></div>
</div>