[krh/weston/next 6/8] compositor-x11: Check if an output is found in x11_compositor_deliver_motion_event.

John Kåre Alsaker john.kare.alsaker at gmail.com
Tue Oct 16 10:31:18 PDT 2012


On Tue, Oct 16, 2012 at 5:43 PM, Kristian Høgsberg <hoegsberg at gmail.com> wrote:
> On Fri, Oct 12, 2012 at 12:25:10PM +0200, John Kåre Alsaker wrote:
>> ---
>>  src/compositor-x11.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/src/compositor-x11.c b/src/compositor-x11.c
>> index 97c6698..5f64795 100644
>> --- a/src/compositor-x11.c
>> +++ b/src/compositor-x11.c
>> @@ -760,6 +760,8 @@ x11_compositor_deliver_motion_event(struct x11_compositor *c,
>>       if (!c->has_xkb)
>>               update_xkb_state_from_core(c, motion_notify->state);
>>       output = x11_compositor_find_output(c, motion_notify->event);
>> +     if(!output)
>> +             return;
>
> Did this ever happen?  The only windows we get events from are the
> output windows...
>
> Kristian
>
It probably can't happen, but x11_compositor_find_output is defined to
return NULL. That could be replaced with abort/assert instead.

>>       x = wl_fixed_from_int(motion_notify->event_x);
>>       y = wl_fixed_from_int(motion_notify->event_y);
>>       x11_output_transform_coordinate(output, &x, &y);
>> --
>> 1.7.12.2
>>
>> _______________________________________________
>> 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