[PATCH] compositor-wayland: use input region instead of opaque region to zxdg_shell_v6::set_window_geometry

Pekka Paalanen ppaalanen at gmail.com
Fri Oct 13 11:15:04 UTC 2017


On Mon, 25 Sep 2017 11:57:37 +0200
Sergi Granell <xerpi.g.12 at gmail.com> wrote:

> The opaque region is a few pixels off due to the rounded corners
> of the frame decorations, and, therefore, the input region
> matches the window's geometry more closely.
> 
> Signed-off-by: Sergi Granell <xerpi.g.12 at gmail.com>
> ---
>  libweston/compositor-wayland.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c
> index b144d6e5..a99d4a5c 100644
> --- a/libweston/compositor-wayland.c
> +++ b/libweston/compositor-wayland.c
> @@ -779,12 +779,6 @@ wayland_output_resize_surface(struct wayland_output *output)
>  		wl_surface_set_input_region(output->parent.surface, region);
>  		wl_region_destroy(region);
>  
> -		frame_opaque_rect(output->frame, &ix, &iy, &iwidth, &iheight);
> -		region = wl_compositor_create_region(b->parent.compositor);
> -		wl_region_add(region, ix, iy, iwidth, iheight);
> -		wl_surface_set_opaque_region(output->parent.surface, region);
> -		wl_region_destroy(region);
> -
>  		if (output->parent.xdg_surface) {
>  			zxdg_surface_v6_set_window_geometry(output->parent.xdg_surface,
>  							    ix,
> @@ -793,6 +787,12 @@ wayland_output_resize_surface(struct wayland_output *output)
>  							    iheight);
>  		}
>  
> +		frame_opaque_rect(output->frame, &ix, &iy, &iwidth, &iheight);
> +		region = wl_compositor_create_region(b->parent.compositor);
> +		wl_region_add(region, ix, iy, iwidth, iheight);
> +		wl_surface_set_opaque_region(output->parent.surface, region);
> +		wl_region_destroy(region);
> +
>  		width = frame_width(output->frame);
>  		height = frame_height(output->frame);
>  	} else {

Yup, sounds like the right thing to do for a simple window to make
geometry and input region match. Pushed:
   be1090b5..b4e239f2  master -> master

Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20171013/5920a75b/attachment.sig>


More information about the wayland-devel mailing list