clients: add a new touchscreen calibrator

Graphics / Wayland / Weston - Louis-Francis Ratté-Boulianne [collabora.com] - 30 May 2018 11:46 EDT

The new calibrator uses weston_touch_calibration protocol extension and provides the following features:

- chooses the physical touch device to be calibrated by DEVPATH or by the output/head name; device enumeration provided

- the compositor ensures the calibrator window is shown in the correct position and size

- no matter how wrong the old calibration is, the touch events will always arrive in the application

- the calibration is complete, not incremental; the received touch events are guaranteed to be unmodified

- computes a libinput style calibration matrix directly, not the WL_CALIBRATION format

- supports multiple touch devices: calibrate one device at a time, and show user feedback on touching a wrong device instead of recording bad data

- uses four touch point samples: three to compute the calibration, and one to verify the calibration is roughly correct

- consistent exit codes

- upload the new calibration into the server after successful and verified calibration

Due to using special touchscreen calibration protocol extension, this application cannot be tested without touch input from the compositor.

Practically all of the above mentioned are unlike how the old calibrator client worked.

Co-developed by Louis-Francis and Pekka.

v2:- improve help() text- rename wrong_touch_handler() to invalid_touch_handler()- improve debug prints by adding sample number- reorganize code into sample funcs vs. touch funcs- add a state machine to properly process touch and related events

b79dead1 clients: add a new touchscreen calibrator
.gitignore | 1 +
Makefile.am | 14 +
clients/touch-calibrator.c | 970 +++++++++++++++++++++++++++++++++++++++++++++
clients/window.c | 4 +-
clients/window.h | 4 +
5 files changed, 991 insertions(+), 2 deletions(-)

Upstream: cgit.freedesktop.org


  • Share