[PATCH] tests: attach the surface's buffer when moving it

Kristian Høgsberg hoegsberg at gmail.com
Mon Mar 4 09:34:18 PST 2013


On Thu, Feb 28, 2013 at 06:44:54PM +0100, Giulio Camuffo wrote:
> move_client() needs to attach the buffer, even if it was attached already,
> because since 184df50 configure() will be called only on newly attached
> surfaces, but the one that sets the test surface position is the configure
> function.
> ---
>  tests/weston-test-client-helper.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Thanks, yes, that's a good fix for that.  I was wondering whether it
would be better to just move the surface and schedule a repaint in the
module, but this way moving the surface is tied in with the commit
machinery.

Kristian

> diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c
> index 1234c62..264dc0d 100644
> --- a/tests/weston-test-client-helper.c
> +++ b/tests/weston-test-client-helper.c
> @@ -84,6 +84,10 @@ move_client(struct client *client, int x, int y)
>  	client->surface->y = y;
>  	wl_test_move_surface(client->test->wl_test, surface->wl_surface,
>  			     surface->x, surface->y);
> +	/* The attach here is necessary because commit() will call congfigure
> +	 * only on surfaces newly attached, and the one that sets the surface
> +	 * position is the configure. */
> +	wl_surface_attach(surface->wl_surface, surface->wl_buffer, 0, 0);
>  	wl_surface_damage(surface->wl_surface, 0, 0, surface->width,
>  			  surface->height);
>  
> @@ -516,7 +520,6 @@ client_create(int x, int y, int width, int height)
>  					       &surface->data);
>  
>  	memset(surface->data, 64, width * height * 4);
> -	wl_surface_attach(surface->wl_surface, surface->wl_buffer, 0, 0);
>  
>  	move_client(client, x, y);
>  
> -- 
> 1.8.1.4
> 
> _______________________________________________
> 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