[PATCH] shell: don't crash if a pointer's focus is null
Kristian Høgsberg
hoegsberg at gmail.com
Fri Nov 22 13:34:32 PST 2013
On Fri, Nov 22, 2013 at 04:21:20PM +0100, pochu27 at gmail.com wrote:
> From: Emilio Pozuelo Monfort <emilio.pozuelo at collabora.co.uk>
>
> It's possible for a pointer's focus to be null, e.g. because
> the focus surface has been bestroyed. Prevent a crash when
> that happens and a client takes too long to respond to a ping.
>
> Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo at collabora.co.uk>
Patch applied, thanks.
Kristian
> ---
> src/shell.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/shell.c b/src/shell.c
> index 82c3cd8..ce8e9dd 100644
> --- a/src/shell.c
> +++ b/src/shell.c
> @@ -1861,7 +1861,8 @@ ping_timeout_handler(void *data)
> shsurf->unresponsive = 1;
>
> wl_list_for_each(seat, &shsurf->surface->compositor->seat_list, link)
> - if (seat->pointer->focus->surface == shsurf->surface)
> + if (seat->pointer->focus &&
> + seat->pointer->focus->surface == shsurf->surface)
> set_busy_cursor(shsurf, seat->pointer);
>
> return 1;
> --
> 1.8.4.rc3
>
> _______________________________________________
> 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