[PATCH 1/2] simple-touch: Make sure shm formats have been enumerated.

Pekka Paalanen ppaalanen at gmail.com
Wed May 14 23:30:48 PDT 2014


On Wed, 14 May 2014 17:40:13 +0200
Paul Liétar <paul at lietar.net> wrote:

> The first roundtrip only ensures the globals have been enumerated by the
> registry.
> 
> After binding wl_shm, we need a new roundtrip to make sure the formats
> have been enumerated, otherwise we might check for has_argb too early.
> 
> This is similar to the simple-shm example.
> 
> Signed-off-by: Paul Liétar <paul at lietar.net>
> ---
>  clients/simple-touch.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/clients/simple-touch.c b/clients/simple-touch.c
> index d8439ac..d29912f 100644
> --- a/clients/simple-touch.c
> +++ b/clients/simple-touch.c
> @@ -311,7 +311,12 @@ touch_create(int width, int height)
>     touch->has_argb = 0;
>     touch->registry = wl_display_get_registry(touch->display);
>     wl_registry_add_listener(touch->registry, &registry_listener, touch);
> -       wl_display_dispatch(touch->display);
> +       wl_display_roundtrip(touch->display);
> +       if (touch->shm == NULL) {
> +               fprintf(stderr, "No wl_shm global\n");
> +               exit(1);
> +       }
> +
>     wl_display_roundtrip(touch->display);
>  
>     if (!touch->has_argb) {

Hi,

I think the change is good, but looking at the strange indentation, I
think the patch is whitespace damaged. It looks like you did use
git-send-email, so I'm not sure how that could have happened.


Thanks,
pq


More information about the wayland-devel mailing list