[PATCH libinput v3 5/5] libinput: add orientation and size of touch point and pressure to the API

Peter Hutterer peter.hutterer at who-t.net
Sat Jul 4 22:25:54 PDT 2015


On 3/07/2015 23:50 , Andreas Pokorny wrote:
> Hi,
>
> On Thu, Jun 25, 2015 at 8:03 AM, Peter Hutterer <peter.hutterer at who-t.net>
> wrote:
>
>> [...]
>>> -             break;
>>> -     case ABS_MT_TRACKING_ID:
>>> +     } else if(e->code == ABS_MT_TRACKING_ID) {
>>>                if (device->pending_event != EVDEV_NONE &&
>>>                    device->pending_event != EVDEV_ABSOLUTE_MT_MOTION)
>>>                        evdev_flush_pending_event(device, time);
>>> -             if (e->value >= 0)
>>> +             if (e->value >= 0) {
>>>                        device->pending_event = EVDEV_ABSOLUTE_MT_DOWN;
>>> -             else
>>> +                     current_slot->available_data =
>> TOUCH_SLOT_DATA_NONE;
>>> +                     current_slot->pressure = DEFAULT_TOUCH_PRESSURE;
>>> +                     current_slot->orientation =
>> DEFAULT_TOUCH_ORIENTATION;
>>> +                     current_slot->touch_major = DEFAULT_TOUCH_MAJOR;
>>> +                     current_slot->touch_minor = DEFAULT_TOUCH_MINOR;
>>
>> no, get this from libevdev, otherwise we may have the wrong value if the
>> kernel skips it when the value is unchanged to the last event. that's
>> unlikely enough, but one of the bugs that's painful to debug when it does
>> happen. see  libevdev_get_slot_value().
>>
>
> But libevdev should not have values in this case. This branch happens when
> a touch trackin id is removed.
> So after the finger was lifted.

libevdev still keeps the values, it doesn't reset them. and whether a 
slot is active or not doesn't matter, it doesn't track touches. so as 
long as the slot number is valid, the value to query is valid.

Cheers,
   Peter

> I agree with all the other findings. It was a busy week. I guess I can
> finish this over the weekend.
> I also settled with the idea of using zero as indicator that there is no
> value available, which works well
> with pressure and touch ellipse size, and does not matter for orientation
>
> regards
> Andreas
>



More information about the wayland-devel mailing list