[PATCH] shell: Set a surface as TOPLEVEL instead of the old surface types.
Kristian Høgsberg
hoegsberg at gmail.com
Thu Dec 5 15:55:23 PST 2013
On Thu, Dec 05, 2013 at 06:53:17PM -0200, Rafael Antognolli wrote:
> Since internally there's no more SHELL_SURFACE_FULLSCREEN and
> SHELL_SURFACE_MAXIMIZED, the surface must be set to
> SHELL_SURFACE_TOPLEVEL on the respective functions.
>
> This fixes the bug when clients start already in fullscreen mode. In
> that case, they aren't set first to toplevel, and then change to
> fullscreen. They are set as fullscreen directly, not receiving the
> SHELL_SURFACE_TOPLEVEL type on the set_fullscreen function.
> ---
> desktop-shell/shell.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index 7c202ea..0b6a97c 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -2168,6 +2168,7 @@ shell_surface_set_transient(struct wl_client *client,
> shell_surface_set_parent(shsurf, parent);
>
> surface_clear_next_states(shsurf);
> + shsurf->next_type = SHELL_SURFACE_TOPLEVEL;
> set_transient(shsurf, parent, x, y, flags);
You tracked down the problem, but the fix isn't right.
set_transient() will do
shsurf->next_type = shsurf->type;
which overwrites SHELL_SURFACE_TOPLEVEL we just stored there. I
edited the fix to just set SHELL_SURFACE_TOPLEVEL in set_transient().
Same for the two other cases. Committed with those changes.
Kristian
> }
>
> @@ -2242,6 +2243,7 @@ shell_surface_set_fullscreen(struct wl_client *client,
> shell_surface_set_parent(shsurf, NULL);
>
> surface_clear_next_states(shsurf);
> + shsurf->next_type = SHELL_SURFACE_TOPLEVEL;
> shsurf->next_state.fullscreen = true;
> shsurf->state_changed = true;
> set_fullscreen(shsurf, method, framerate, output);
> @@ -2340,6 +2342,7 @@ shell_surface_set_maximized(struct wl_client *client,
> shell_surface_set_parent(shsurf, NULL);
>
> surface_clear_next_states(shsurf);
> + shsurf->next_type = SHELL_SURFACE_TOPLEVEL;
> shsurf->next_state.maximized = true;
> shsurf->state_changed = true;
> set_maximized(shsurf, output);
> --
> 1.8.3.1
>
> _______________________________________________
> 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