Correct width/height values from X11Wacom::getMaximumTabletArea

Authored by jgerecke on Jun 13 2019, 8:49 PM.

Description

Correct width/height values from X11Wacom::getMaximumTabletArea

Summary:
The "Wacom Tablet Area" property contains four values that define the
top-left and bottom-right tablet coordinates of the tablet's input
area. The driver will scale input coordinates according to the input
area such that the border of the input area matches up with the border
of the desktop or mapped monitor.

Crucially, these coordinates are *NOT* necessarily equal to (0,0) and
(SENSOR_MAX_X, SENSOR_MAX_Y) after a reset. In particular, many display
tablet have sensors that are slightly larger than the display itself
and so have their reset areas equal to something like (400, 400) and
(SENSOR_MAX_X - 400, SENSOR_MAX_Y - 400) so that the pen is correctly
mapped.

This commit updates X11Wacom::getMaximumTabletArea to properly set the
width and height properties by calculating the difference between the
min and max values of X and Y. This is particularly important to ensure
that the calibration routines work correctly.

Ref: https://bugs.kde.org/show_bug.cgi?id=407712

Reviewers: valeriymalov

Reviewed By: valeriymalov

Differential Revision: https://phabricator.kde.org/D21775