[PATCH weston v2] input: check if the focus surface has a valid resource

Jason Ekstrand jason at jlekstrand.net
Thu Jun 20 14:44:55 PDT 2013


All,
This looks good as far as I'm concerned.
--Jason Ekstrand
On Jun 20, 2013 11:15 AM, "Giulio Camuffo" <giuliocamuffo at gmail.com> wrote:

> the resource can be NULL in some cases, like when the focus is
> taken by the black_surface used in shell.c as fullscreen background.
> ---
>
> sorry for the noise, v1 has spaces instead of tabs
>
>  src/input.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/input.c b/src/input.c
> index e670eb6..ad4512d 100644
> --- a/src/input.c
> +++ b/src/input.c
> @@ -1110,6 +1110,11 @@ pointer_set_cursor(struct wl_client *client, struct
> wl_resource *resource,
>
>         if (pointer->focus == NULL)
>                 return;
> +       /* pointer->focus->resource can be NULL. Surfaces like the
> +       black_surface used in shell.c for fullscreen don't have
> +       a resource, but can still have focus */
> +       if (pointer->focus->resource == NULL)
> +               return;
>         if (wl_resource_get_client(pointer->focus->resource) != client)
>                 return;
>         if (pointer->focus_serial - serial > UINT32_MAX / 2)
> --
> 1.8.3.1
>
> _______________________________________________
> 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/20130620/40916b46/attachment.html>


More information about the wayland-devel mailing list