On Fri, 18 Feb 2022 17:04:08 GMT, Alexander Scherbatiy <alex...@openjdk.org> 
wrote:

> Zoomed/Rotated with two fingers rectangle flickers (unexpectedly becomes 
> pretty small or large and then returns back to previous size several times 
> during zooming/rotating) on a Raspberry Pi with Touchscreen.
> 
> The log with traced events shows that it is possible that only one 
> ABS_MT_POSITION_X or ABS_MT_POSITION_Y can be sent for a given slot. In this 
> case the corresponding omitted Y/X value is undefined and is assigned from 
> ABS_Y/X value. This produces incorrect result for slots different from 0.
> 
> Example of the trace events log, enabled by 
> `-Dmonocle.input.traceEvents.verbose=true -Dmonocle.input.traceEvents=true` 
> flags:
> 
> traceEvent: Processing EV_ABS ABS_MT_SLOT 1 [index=48]
> traceEvent: Processing EV_ABS ABS_MT_TRACKING_ID 302 [index=64]
> traceEvent: Processing EV_ABS ABS_MT_POSITION_X 399 [index=80]
> traceEvent: Processing EV_ABS ABS_MT_POSITION_Y 272 [index=96]
> traceEvent: Processing EV_KEY BTN_TOUCH 1 [index=112]
> traceEvent: Read EV_ABS ABS_MT_SLOT 0 [index=176]
> traceEvent: Read EV_ABS ABS_MT_POSITION_Y 315 [index=192]
> traceEvent: Read EV_ABS ABS_Y 315 [index=208]
> traceEvent: Read EV_SYN SYN_REPORT 0 [index=224]
> 
> ...
> 
> traceEvent: Read EV_ABS ABS_MT_SLOT 1 [index=320]
> traceEvent: Read EV_ABS ABS_MT_POSITION_Y 271 [index=336]
> traceEvent: Read EV_ABS ABS_X 552 [index=352]
> traceEvent: Read EV_ABS ABS_Y 322 [index=368]
> traceEvent: Read EV_SYN SYN_REPORT 0 [index=384]
> 
> First both ABS_MT_POSITION_X/Y events with values x: 399 and y: 272 are 
> received for the slot 1.
> Next only ABS_MT_POSITION_Y with y: 271 value is received (which implies that 
> the x value has not been changed) for the slot 1.
> The x value is undefined in the 
> LinuxStatefulMultiTouchProcessor.processEvents() loop and is unexpectedly 
> assigned to the ABS_X 552 value which belongs to the slot 0.
> 
> The fix skips setting ABS_X/Y values for slots different from 0.

The fix also fixes the first use case described in the JDK-8087370

1. Consider you're touching the screen with two fingers, for example
coordinates of one point is ~100,100 and second point is ~200,200.
While still touching around the same points some events are reported with
one or another point to be either 100,200 or 200,100.

-------------

PR: https://git.openjdk.java.net/jfx/pull/737

Reply via email to