mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-03 11:40:15 +01:00
dix: Save touchpoint last coordinates before transform. #49347
DDXTouchPointInfoRec.valuators used to store axis values after transform.
This resulted in Coordinate Transformation Matrix
being applied multiple times to the last coordinates,
in the case when only pressure changes in the last touch event.
Changed DDXTouchPointInfoRec.valuators to store values before transform.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=49347
Signed-off-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3b9f1c7017)
Conflicts:
dix/getevents.c
This commit is contained in:
parent
d07dfb11c2
commit
310ac85080
2 changed files with 13 additions and 18 deletions
|
|
@ -1951,32 +1951,27 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
|
|||
default:
|
||||
return 0;
|
||||
}
|
||||
if (t->mode == XIDirectTouch && !(flags & TOUCH_CLIENT_ID)) {
|
||||
if (!valuator_mask_isset(&mask, 0))
|
||||
valuator_mask_set_double(&mask, 0,
|
||||
valuator_mask_get_double(touchpoint.ti->
|
||||
valuators, 0));
|
||||
if (!valuator_mask_isset(&mask, 1))
|
||||
valuator_mask_set_double(&mask, 1,
|
||||
valuator_mask_get_double(touchpoint.ti->
|
||||
valuators, 1));
|
||||
}
|
||||
|
||||
/* Get our screen event co-ordinates (root_x/root_y/event_x/event_y):
|
||||
* these come from the touchpoint in Absolute mode, or the sprite in
|
||||
* Relative. */
|
||||
if (t->mode == XIDirectTouch) {
|
||||
transformAbsolute(dev, &mask);
|
||||
|
||||
if (!(flags & TOUCH_CLIENT_ID)) {
|
||||
for (i = 0; i < valuator_mask_size(&mask); i++) {
|
||||
double val;
|
||||
for (i = 0; i < max(valuator_mask_size(&mask), 2); i++) {
|
||||
double val;
|
||||
|
||||
if (valuator_mask_fetch_double(&mask, i, &val))
|
||||
valuator_mask_set_double(touchpoint.ti->valuators, i, val);
|
||||
}
|
||||
if (valuator_mask_fetch_double(&mask, i, &val))
|
||||
valuator_mask_set_double(touchpoint.ti->valuators, i, val);
|
||||
/* If the device doesn't post new X and Y axis values,
|
||||
* use the last values posted.
|
||||
*/
|
||||
else if (i < 2 &&
|
||||
valuator_mask_fetch_double(touchpoint.ti->valuators, i, &val))
|
||||
valuator_mask_set_double(&mask, i, val);
|
||||
}
|
||||
}
|
||||
|
||||
transformAbsolute(dev, &mask);
|
||||
clipAbsolute(dev, &mask);
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ typedef struct _DDXTouchPointInfo {
|
|||
uint32_t ddx_id; /* touch ID given by the DDX */
|
||||
Bool emulate_pointer;
|
||||
|
||||
ValuatorMask *valuators; /* last recorded axis values */
|
||||
ValuatorMask *valuators; /* last axis values as posted, pre-transform */
|
||||
} DDXTouchPointInfoRec;
|
||||
|
||||
typedef struct _TouchClassRec {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue