[PATCH weston v2] simple-egl: Reset opaque region if not fullscreen.

Kristian Høgsberg hoegsberg at gmail.com
Mon Nov 19 12:26:59 PST 2012


On Mon, Nov 19, 2012 at 11:00:28AM -0700, Scott Moreau wrote:
> If simple-egl is toggled fullscreen, the opqaue region is set for the surface
> but never removed after exiting fullscreen. This patch resets the opaque region
> to 0 if the surface is not fullscreen and -o was not passed. This fixes the
> problem introduced sometime since d7f282b84e, when this was last fixed.
> ---
> 
> Hi Ander,
> 
> Thanks for the notice. You are right, I've removed the gratuitous region
> add/remove calls.
> 
> 
> v2:
> 
> Don't add new region to reset since the default is empty.
> 
>  clients/simple-egl.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/clients/simple-egl.c b/clients/simple-egl.c
> index 735a9c7..9fcf064 100644
> --- a/clients/simple-egl.c
> +++ b/clients/simple-egl.c
> @@ -437,6 +437,9 @@ redraw(void *data, struct wl_callback *callback, uint32_t time)
>  			      window->geometry.height);
>  		wl_surface_set_opaque_region(window->surface, region);
>  		wl_region_destroy(region);
> +	} else {
> +		region = wl_compositor_create_region(window->display->compositor);
> +		wl_surface_set_opaque_region(window->surface, region);

Nice catch, Scott.  This leaks a region however (you need to call
wl_region_destroy).  However, you don't even need to create a region
to clear the opaque region, just pass in NULL.

Kristian

>  	}
>  
>  	window->callback = wl_surface_frame(window->surface);
> -- 
> 1.7.11.7
> 
> _______________________________________________
> 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