[PATCH 2/2] exposay: set an alpha on fullscreen surfaces
Kristian Høgsberg
hoegsberg at gmail.com
Tue Jan 7 21:49:20 PST 2014
On Tue, Jan 07, 2014 at 04:41:40PM +0100, pochu27 at gmail.com wrote:
> From: Emilio Pozuelo Monfort <emilio.pozuelo at collabora.co.uk>
>
> This makes the desktop background actually draw when there is
> a fullscreen surface and we go to exposay.
> ---
>
> I'm not sure if this one is right, but it does the trick... If this
> is not too hacky I could split set_alpha_if_fullscreen() into
> is_fullscreen() and set_alpha() and do the right thing from exposay.c
> if that is preferred.
It's fine for now. I think we should fade out and then destroy the
black surfaces when we initiate exposay or alt-tab, but with this
patch, at least exposay and alt-tab does the same thing.
Thanks,
Kristian
> desktop-shell/exposay.c | 2 ++
> desktop-shell/shell.c | 7 +++++++
> desktop-shell/shell.h | 3 +++
> 3 files changed, 12 insertions(+)
>
> diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c
> index f409aa3..01bf0b1 100644
> --- a/desktop-shell/exposay.c
> +++ b/desktop-shell/exposay.c
> @@ -286,6 +286,8 @@ exposay_layout(struct desktop_shell *shell)
> if (shell->exposay.focus_current == esurface->view)
> highlight = esurface;
>
> + set_alpha_if_fullscreen(get_shell_surface(view->surface));
> +
> exposay_animate_in(esurface);
>
> i++;
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index f85a269..4cc23d5 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -222,6 +222,13 @@ struct shell_seat {
> } popup_grab;
> };
>
> +void
> +set_alpha_if_fullscreen(struct shell_surface *shsurf)
> +{
> + if (shsurf && shsurf->state.fullscreen)
> + shsurf->fullscreen.black_view->alpha = 0.25;
> +}
> +
> static struct desktop_shell *
> shell_surface_get_shell(struct shell_surface *shsurf);
>
> diff --git a/desktop-shell/shell.h b/desktop-shell/shell.h
> index 7a8194d..8ef550f 100644
> --- a/desktop-shell/shell.h
> +++ b/desktop-shell/shell.h
> @@ -188,6 +188,9 @@ struct desktop_shell {
> char *client;
> };
>
> +void
> +set_alpha_if_fullscreen(struct shell_surface *shsurf);
> +
> struct weston_output *
> get_default_output(struct weston_compositor *compositor);
>
> --
> 1.8.5.2
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list