[PATCH weston v1 13/17] tests: make frame_callback_wait universal

Pekka Paalanen ppaalanen at gmail.com
Mon Dec 15 00:22:19 PST 2014


On Fri,  5 Dec 2014 14:36:46 +0100
Marek Chalupa <mchqwerty at gmail.com> wrote:

> frame_callback_wait uses wl_display_dispatch. Use display_dispatch
> for toytoolkit clients.
> 
> Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
> ---
>  tests/weston-test-client-helper.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c
> index ae104a8..dc34fc4 100644
> --- a/tests/weston-test-client-helper.c
> +++ b/tests/weston-test-client-helper.c
> @@ -70,11 +70,20 @@ frame_callback_set(struct wl_surface *surface, int *done)
>  	return callback;
>  }
>  
> +static int
> +client_dispatch(struct client *client)
> +{
> +	if (client->toytoolkit)
> +		return display_dispatch(client->toytoolkit->display, -1);
> +	else
> +		return wl_display_dispatch(client->wl_display);
> +}
> +
>  int
>  frame_callback_wait_nofail(struct client *client, int *done)
>  {
>  	while (!*done) {
> -		if (wl_display_dispatch(client->wl_display) < 0)
> +		if (client_dispatch(client) < 0)
>  			return 0;
>  	}
>  

Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>


More information about the wayland-devel mailing list