[PATCH 02/12] shell.c: Restore maximized and fullscreen window on destroyed output

Zhang, Xiong Y xiong.y.zhang at intel.com
Mon Mar 17 22:39:39 PDT 2014


On Mon, 2014-03-17 at 19:17 +0200, Ander Conselvan de Oliveira wrote:


On 03/07/2014 10:27 AM, Xiong Zhang wrote:
> When maximized or fullscreen window is on destroyed output, compositor
> can't change these windows to normal window without notify client,
> otherwise maximize icon or F11 buttion lose its effect after output unplug.
>
> Instead we keep these window as maximized or fullscreen, just change
> it's size to target output.

I'm not sure about this. xdg-shell lets us handle this properly and
wl_shell should be deprecated at some point, so I'm more inclined to
keep the current behavior.





Cheers,
Ander



yes, using xdg-shell, maximize icon and F11 button can take effect after output unplug.
But server secretly changes window's state from maximized to unmaximized without notifying client, it's unreasonable. If the unplugged output is much larger than remaining output, the maximized window can't been fully displayed on remaining output when the output of maximized window is unplugged. In order to restore this window to normal, user must move this window to see the maximize icon. It isn't convenient for user.

thanks.


>
> Signed-off-by: Xiong Zhang <xiong.y.zhang at intel.com<mailto:xiong.y.zhang at intel.com>>
> ---
>   desktop-shell/shell.c | 24 +++++++++++++++++++++---
>   1 file changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index bee1b0b..02dd1b8 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -5534,6 +5534,7 @@ shell_reposition_view_on_output_destroy(struct weston_view *view)
>       struct shell_surface *shsurf;
>       float x, y;
>       int visible;
> +     struct weston_view *black_view;
>
>       x = view->geometry.x;
>       y = view->geometry.y;
> @@ -5557,6 +5558,8 @@ shell_reposition_view_on_output_destroy(struct weston_view *view)
>               x = first_output->x + first_output->width / 4;
>               y = first_output->y + first_output->height / 4;
>
> +             output = first_output;
> +
>               weston_view_set_position(view, x, y);
>       } else
>               weston_view_geometry_dirty(view);
> @@ -5566,9 +5569,24 @@ shell_reposition_view_on_output_destroy(struct weston_view *view)
>
>       if (shsurf) {
>               shsurf->saved_position_valid = false;
> -             shsurf->next_state.maximized = false;
> -             shsurf->next_state.fullscreen = false;
> -             shsurf->state_changed = true;
> +
> +             /* Resize maxmized window to target output. */
> +             if (shsurf->state.maximized)
> +                     set_maximized(shsurf, output);
> +
> +             /* Resize fullscreen window to target output. */
> +             if (shsurf->state.fullscreen) {
> +                     black_view = shsurf->fullscreen.black_view->surface;
> +                     weston_surface_destroy(black_view->surface);
> +                     shsurf->fullscreen.black_view = NULL;
> +
> +                     set_fullscreen(shsurf,
> +                                    shsurf->fullscreen.type,
> +                                    shsurf->fullscreen.framerate,
> +                                    output);
> +             }
> +
> +             shsurf->state_changed = false;
>       }
>   }
>
>

_______________________________________________
wayland-devel mailing list
wayland-devel at lists.freedesktop.org<mailto:wayland-devel at lists.freedesktop.org>
http://lists.freedesktop.org/mailman/listinfo/wayland-devel




More information about the wayland-devel mailing list