[PATCH weston] input: check that the new focus surface has a valid resource

Giulio Camuffo giuliocamuffo at gmail.com
Mon Sep 23 10:29:47 PDT 2013


2013/9/23 Kristian Høgsberg <hoegsberg at gmail.com>:
> On Mon, Sep 23, 2013 at 12:33:39PM +0200, Giulio Camuffo wrote:
>> Here too we must make sure the surface has a valid resource, as
>> there are some (xwayland, surfaces created by the shell) that
>> don't have it.
>> Fix a Weston crash when setting a mpv window fullscreen on drm.
>
> We have the same problem for keyboard and touch set_focus functions
> don't we?  Anyway, applied this patch, thanks.

Maybe, yes. But it doesn't crash for me, and the old code didn't check
for it, so
maybe it's a code path that surfaces without resource don't hit for some reason.

Giulio

>
> Kristian
>
>> ---
>>  src/input.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/input.c b/src/input.c
>> index 01ec059..1313b52 100644
>> --- a/src/input.c
>> +++ b/src/input.c
>> @@ -503,7 +503,7 @@ weston_pointer_set_focus(struct weston_pointer *pointer,
>>               pointer->focus_serial = serial;
>>       }
>>
>> -     if (kbd && surface && kbd->focus != pointer->focus) {
>> +     if (kbd && surface && surface->resource && kbd->focus != pointer->focus) {
>>               struct wl_client *surface_client =
>>                       wl_resource_get_client(surface->resource);
>>               send_modifiers_to_client_in_list(surface_client,
>> --
>> 1.8.4
>>
>> _______________________________________________
>> 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