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

Peter Hutterer peter.hutterer at who-t.net
Mon Jun 22 15:03:46 PDT 2015


On Mon, Jun 22, 2015 at 12:37:43PM +0200, Andreas Pokorny wrote:
> Hi,
> 
> 
> On Mon, Jun 22, 2015 at 3:37 AM, Peter Hutterer <peter.hutterer at who-t.net>
> wrote:
> 
> > On Fri, Jun 19, 2015 at 03:24:38PM +0200, Andreas Pokorny wrote:
> > > +      * */
> > > +     if (orientation_info) {
> > > +             if (orientation_info->maximum == 1 &&
> > > +                 orientation_info->maximum == 0)
> > > +                     return orientation == 0?90.0:0.0;
> >
> > spaces around ? and :
> >
> > > +     }
> > > +     else
> > > +             return DEFAULT_TOUCH_ORIENTATION;
> >
> > { } for if + else when either of them requires it, please check the
> > CODING_STYLE document.
> >
> 
> That info is not yet in the CODING_STYLE.

oops, sorry. I wrote that doc twice thanks to a overzealous git reset, it
clearly didn't make it into the second version, fixed now.

> 
> 
> 
> > > +}
> > > +
> > > +double
> > > +evdev_device_transform_pressure(struct evdev_device *device,
> > > +                             int32_t pressure)
> > > +{
> > > +     const struct input_absinfo *pressure_info =
> > device->abs.absinfo_pressure;
> > > +
> > > +     if (pressure_info)
> > > +             return (double)(pressure - pressure_info->minimum) /
> > > +                     (pressure_info->maximum - pressure_info->minimum);
> >
> > tmp variable for min/max here too please
> >
> > > +                                       slot_data->pressure);
> > >               break;
> > >       case EVDEV_ABSOLUTE_MT_UP:
> > >               if (!(device->seat_caps & EVDEV_DEVICE_TOUCH))
> > > @@ -371,7 +447,9 @@ evdev_flush_pending_event(struct evdev_device
> > *device, uint64_t time)
> > >               point = device->abs.point;
> > >               transform_absolute(device, &point);
> > >
> > > -             touch_notify_touch_down(base, time, -1, seat_slot, &point);
> > > +             touch_notify_touch_down(base, time, -1, seat_slot, &point,
> > > +                                     DEFAULT_TOUCH_MAJOR,l
> > DEFAULT_TOUCH_MINOR,
> >
> > does this even compile?
> >
> 
> ouch how embarrassing. I added that error while reiterating and cleaning
> out (most) expanded tabs..
> 
> 
> >
> > > +                                     DEFAULT_TOUCH_ORIENTATION,
> > DEFAULT_TOUCH_PRESSURE);
> >
> > one arg per line.
> >
> 
> Ok - on that one I was about to do it, but hesitated as the existing code
> wrapped in the middle of the parameter set.

yeah, some code still does that and we'll fix that as we replace it. but for
new code, please use one arg per line

Cheers,
   Peter
 
 
> > [...]
> >
> ok, I'm going to skip the rest. Please go through this patchset again and
> > make sure you adhere to the coding style before resubmitting. The odd issue
> > here and there is one thing, but having that many, including a compilation
> > errors should not happen.
> >
> 
> Fine, found some further violations - resending another version now. Thanks
> for the review.
> 
> regards
> Andreas Pokorny


More information about the wayland-devel mailing list