[PATCH 1/4] shell: block move, rotate, resize in maximized state

Kristian Høgsberg hoegsberg at gmail.com
Tue Mar 19 09:15:18 PDT 2013


On Mon, Mar 11, 2013 at 07:26:53PM +0100, Rafal Mielniczuk wrote:
> To remain consisten with client side window, which blocks moving and
> resizing of window in maximized state, we should do so on the compositor
> side as well.

Yeah, makes sense.  Committed (with a couple of white space edits as
described below).

> (until there is some unmaximize notification from server, which will
> allow window to start drawing shadows and revert itself to toplevel
> state)

Let's add that then :)

Kristian

> ---
>  src/shell.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/src/shell.c b/src/shell.c
> index 3da5321..d8467bd 100644
> --- a/src/shell.c
> +++ b/src/shell.c
> @@ -1175,7 +1175,8 @@ surface_resize(struct shell_surface *shsurf,
>  {
>  	struct weston_resize_grab *resize;
>  
> -	if (shsurf->type == SHELL_SURFACE_FULLSCREEN)
> +	if (shsurf->type == SHELL_SURFACE_FULLSCREEN ||
> +		shsurf->type == SHELL_SURFACE_MAXIMIZED)

Here, the continuation line should be aligned with the line above,
that is, 'shsurf' should be at the same column in both lines:

	if (shsurf->type == SHELL_SURFACE_FULLSCREEN ||
	    shsurf->type == SHELL_SURFACE_MAXIMIZED)

and similar for the other cases.

>  		return 0;
>  
>  	if (edges == 0 || edges > 15 ||
> @@ -2412,7 +2413,8 @@ move_binding(struct wl_seat *seat, uint32_t time, uint32_t button, void *data)
>  		return;
>  
>  	shsurf = get_shell_surface(surface);
> -	if (shsurf == NULL || shsurf->type == SHELL_SURFACE_FULLSCREEN)
> +	if (shsurf == NULL || shsurf->type == SHELL_SURFACE_FULLSCREEN ||
> +		shsurf->type == SHELL_SURFACE_MAXIMIZED)
>  		return;
>  
>  	surface_move(shsurf, (struct weston_seat *) seat);
> @@ -2431,7 +2433,8 @@ resize_binding(struct wl_seat *seat, uint32_t time, uint32_t button, void *data)
>  		return;
>  
>  	shsurf = get_shell_surface(surface);
> -	if (!shsurf || shsurf->type == SHELL_SURFACE_FULLSCREEN)
> +	if (!shsurf || shsurf->type == SHELL_SURFACE_FULLSCREEN ||
> +		shsurf->type == SHELL_SURFACE_MAXIMIZED)
>  		return;
>  
>  	weston_surface_from_global(surface,
> @@ -2690,7 +2693,8 @@ rotate_binding(struct wl_seat *seat, uint32_t time, uint32_t button,
>  		return;
>  
>  	surface = get_shell_surface(base_surface);
> -	if (!surface || surface->type == SHELL_SURFACE_FULLSCREEN)
> +	if (!surface || surface->type == SHELL_SURFACE_FULLSCREEN ||
> +		surface->type == SHELL_SURFACE_MAXIMIZED)
>  		return;
>  
>  	surface_rotate(surface, seat);
> -- 
> 1.8.1.5
> 
> _______________________________________________
> 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