[PATCH weston v2 10/12] weston: add touchscreen_calibrator option
ppaalanen at gmail.com
Wed May 30 12:09:15 UTC 2018
On Wed, 30 May 2018 12:25:02 +1000
Peter Hutterer <peter.hutterer at who-t.net> wrote:
> On Mon, Apr 30, 2018 at 04:03:32PM +0300, Pekka Paalanen wrote:
> > From: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
> > Add an option to enable the touchscreen calibrator interface. This is a
> > global on/off toggle, in lack of more fine-grained access restrictions.
> > As Weston should not hardcode system specifics, the actual permanent
> > saving of a new calibration is left for a user supplied script or a
> > program. Usually this script would write an appropriate udev rule to set
> > LIBINPUT_CALIBRATION_MATRIX for the touch device.
> > Co-developed by Louis-Francis and Pekka.
> > v2:
> > - use syspath instead of devpath
> > Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
> > Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> > v1 Tested-by: Matt Hoosier <matt.hoosier at gmail.com>
> > ---
> > compositor/main.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > man/weston.ini.man | 39 +++++++++++++++++++++++++++++++
> > 2 files changed, 107 insertions(+)
> > diff --git a/man/weston.ini.man b/man/weston.ini.man
> > index f237fd60..b5668b5a 100644
> > --- a/man/weston.ini.man
> > +++ b/man/weston.ini.man
> > @@ -200,8 +200,47 @@ Available configuration are:
> > .TP 7
> > .BI "enable_tap=" true
> > enables tap to click on touchpad devices
> > +.TP 7
> > +.BI "touchscreen_calibrator=" true
> > +Advertise the touchscreen calibrator interface to all clients. This is a
> > +potential denial-of-service attack vector, so it should only be enabled on
> > +trusted userspace. Boolean, defaults to
> > +.BR false .
> > +
> > +The interface is required for running touchscreen calibrator applications. It
> > +provides the application raw touch events, bypassing the normal touch handling.
> > +It also allows the application to upload a new calibration into the compositor.
> > +
> > +Even though this option is listed in the libinput section, it does affect all
> > +Weston configurations regardless of the used backend. If the backend does not
> > +use libinput, the interface can still be advertised, but it will not list any
> > +devices.
> > +.TP 7
> > +.BI "calibration_helper=" /bin/echo
> was a bit confused by your choice of /bin/echo here, but otherwise the whole
> series is
> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
very much appreciated.
Yeah, I could not think of anything better, it's executed through
system(), and there is no well-known program that would even come close
nor installed with Weston. It's totally system specific. This may be
the least thought-out part in the series.
I've actually used /bin/echo when testing it, it works fine for that.
995bf51b..bfaaedc9 master -> master
> > +An optional calibration helper program to permanently save a new touchscreen
> > +calibration. String, defaults to unset.
> > +
> > +The given program will be executed with seven arguments when a calibrator
> > +application requests the server to take a new calibration matrix into use.
> > +The program is executed synchronously and will therefore block Weston for its
> > +duration. If the program exit status is non-zero, Weston will not apply the
> > +new calibration. If the helper is unset or the program exit status is zero,
> > +Weston will use the new calibration immediately.
> > +
> > +The program is invoked as:
> > +.PP
> > +.RS 10
> > +.I calibration_helper syspath m1 m2 m3 m4 m5 m6
> > +.RE
> > .RS
> > .PP
> > +.RI "where " syspath
> > +is the udev sys path for the device and
> > +.IR m1 " through " m6
> > +are the calibration matrix elements in libinput's
> > +.BR LIBINPUT_CALIBRATION_MATRIX " udev property format."
> > +The sys path is an absolute path and starts with the sys mount point.
> > +.RE
> > .SH "SHELL SECTION"
> > The
> > --
> > 2.16.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 833 bytes
Desc: OpenPGP digital signature
More information about the wayland-devel