[PATCH weston] shell: Don't draw shadows for maximized windows.

Pekka Paalanen ppaalanen at gmail.com
Wed Aug 8 02:31:57 PDT 2012


On Tue,  7 Aug 2012 21:39:37 -0600
Scott Moreau <oreaus at gmail.com> wrote:

> This effectively fixes a bug where maximized windows appear to not maximize
> fully bacause of the shadow margin. Instead, we now maximize the window to
> the understood input region.
> ---
> 
> This problem is much more easily and appropriately fixed in shell.c but it makes
> the assumption that the input_region is the same for top/bottom and left/right.
> We can't calulate bottom or right margin in shell_surface_set_maximized()
> because the input region hasn't been updated and there's no way to know in
> advance before the configure event. So we have the client resize its surface
> accounting for the (shadow) margin, which in this case, is a constant margin for
> all sides, derived from the theme margin. We then position the surface taking
> into consideration the same.
> 
>  src/shell.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/src/shell.c b/src/shell.c
> index 6c810ff..0580aeb 100644
> --- a/src/shell.c
> +++ b/src/shell.c
> @@ -1362,8 +1362,11 @@ shell_surface_set_maximized(struct wl_client *client,
>  	edges = WL_SHELL_SURFACE_RESIZE_TOP|WL_SHELL_SURFACE_RESIZE_LEFT;
>  
>  	shsurf->client->send_configure(shsurf->surface, edges,
> -				       shsurf->output->current->width,
> -				       shsurf->output->current->height - panel_height);
> +				       shsurf->output->current->width +
> +				       shsurf->surface->input.extents.x1 * 2,
> +				       shsurf->output->current->height -
> +				       panel_height +
> +				       shsurf->surface->input.extents.y1 * 2);
>  
>  	shsurf->next_type = SHELL_SURFACE_MAXIMIZED;
>  }
> @@ -2673,9 +2676,10 @@ configure(struct desktop_shell *shell, struct weston_surface *surface,
>  		break;
>  	case SHELL_SURFACE_MAXIMIZED:
>  		/* setting x, y and using configure to change that geometry */
> -		surface->geometry.x = surface->output->x;
> +		surface->geometry.x = surface->output->x - surface->input.extents.x1;
>  		surface->geometry.y = surface->output->y +
> -			get_output_panel_height(shell,surface->output);
> +			get_output_panel_height(shell,surface->output -
> +			surface->input.extents.y1);
>  		break;
>  	case SHELL_SURFACE_TOPLEVEL:
>  		break;

This is definitely not right. It is not the compositor's job to cut out
and not show an arbitrary part of the surface. It is the client's job
to not render anything it does not want to show.

You also break the protocol by lying to client about the dimensions,
and in doing so, you make assumptions that are not based on any
specification, just like you mentioned yourself.

This must be done in toytoolkit, not here.


Sorry,
pq


More information about the wayland-devel mailing list