Skip to content
Commit 83630983 authored by Louis-Francis Ratté-Boulianne's avatar Louis-Francis Ratté-Boulianne Committed by Pekka Paalanen
Browse files

libweston: implement touch calibration protocol



This implements a new global interface weston_touch_calibration, which
allows one client at a time to perform touchscreen calibration. This
also implements the calibrator window management.

A client asks to calibrate a specific physical touch device (not a
wl_seat which may have several physical touch devices aggregated).
Libweston grabs all touch devices and prevents normal touch event
handling during the calibation sequence.

API is added to enable this new global interface, but it not yet called
by anything. Since the implementation allows clients to grab touch devices
arbitrarily, it is not enabled by default. The compositor should take
measures to prevent unexpected access to the interface.

A client may upload a new calibration to the compositor. There is a
vfunc to allow the compositor to reject/accept it and save it to
persistent storage. The persistent storage could be a udev rule
setting LIBINPUT_CALIBRATION_MATRIX, so that all display server would
load the new calibration automatically.

Co-developed by Louis-Francis and Pekka.

v2:
- use struct weston_point2d_device_normalized
- use syspath instead of devpath
- wrong_touch was renamed to invalid_touch
- rename weston_touch_calibrator::cancelled to calibration_cancelled
- send invalid_touch on out-of-bounds touch-down
- cancel touch sequence and send invalid_touch on motion going
  out-of-bounds
- rename calcoord_from_double() to wire_uint_from_double()
- send bad_coordinates error in touch_calibrator_convert()
- conversion results in 0,0 if cancelled

Signed-off-by: default avatarLouis-Francis Ratté-Boulianne <lfrb@collabora.com>
Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: default avatarMatt Hoosier <matt.hoosier@gmail.com>
Reviewed-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 999876a8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment