[PATCH weston] input: check if the resource is valid in seat_get_pointer

Jason Ekstrand jason at jlekstrand.net
Mon Jul 8 06:56:53 PDT 2013


Looks good to me.
--Jason Ekstrand
On Jul 7, 2013 10:41 AM, "Giulio Camuffo" <giuliocamuffo at gmail.com> wrote:

> seat->pointer->focus->resource can be NULL, if the surface was
> created with weston_surface_create.
> ---
>  src/input.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/input.c b/src/input.c
> index 644487a..a7a37e5 100644
> --- a/src/input.c
> +++ b/src/input.c
> @@ -1181,7 +1181,7 @@ seat_get_pointer(struct wl_client *client, struct
> wl_resource *resource,
>         wl_resource_set_implementation(cr, &pointer_interface,
> seat->pointer,
>                                        unbind_resource);
>
> -       if (seat->pointer->focus &&
> +       if (seat->pointer->focus && seat->pointer->focus->resource &&
>             wl_resource_get_client(seat->pointer->focus->resource) ==
> client) {
>                 struct weston_surface *surface;
>                 wl_fixed_t sx, sy;
> --
> 1.8.3.2
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130708/45f471fb/attachment.html>


More information about the wayland-devel mailing list