[PATCH weston 1/4] input: Use new wl_resource_for_each for sending updated seat caps

Kristian Høgsberg hoegsberg at gmail.com
Wed Sep 11 11:57:52 PDT 2013


On Fri, Sep 06, 2013 at 05:48:19PM +0100, Rob Bradford wrote:
> From: Rob Bradford <rob at linux.intel.com>

Thanks, applied, much nicer with the macro.

Kristian

> ---
>  src/input.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/src/input.c b/src/input.c
> index aa40b4e..e6d074e 100644
> --- a/src/input.c
> +++ b/src/input.c
> @@ -398,8 +398,8 @@ weston_touch_destroy(struct weston_touch *touch)
>  static void
>  seat_send_updated_caps(struct weston_seat *seat)
>  {
> -	struct wl_list *link;
>  	enum wl_seat_capability caps = 0;
> +	struct wl_resource *resource;
>  
>  	if (seat->pointer)
>  		caps |= WL_SEAT_CAPABILITY_POINTER;
> @@ -408,9 +408,8 @@ seat_send_updated_caps(struct weston_seat *seat)
>  	if (seat->touch)
>  		caps |= WL_SEAT_CAPABILITY_TOUCH;
>  
> -	for (link = seat->base_resource_list.next;
> -	     link != &seat->base_resource_list; link = link->next) {
> -		wl_seat_send_capabilities(wl_resource_from_link(link), caps);
> +	wl_resource_for_each(resource, &seat->base_resource_list) {
> +		wl_seat_send_capabilities(resource, caps);
>  	}
>  }
>  
> -- 
> 1.8.3.1
> 
> _______________________________________________
> 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