Details
-
Bug
-
Resolution: Fixed
-
P3
-
8
-
Beagle Board
Description
In lens native code after touch points event is been processed lens_wm_notifyMultiTouchEvent() is been called.
This code in edge cases can drop the event because it can't find a window to notify. The dropped event can cause the Java touch point state machine to get confused and throw and exception.
2 reasons for this were identified:
1) lens_wm_notifyMultiTouchEvent always assume pendingPoint[0] is the index point, but the order of the list is random and the '[0]' point can fall outside a window, causing the event to drop
2) it seems that _dragGrabbingWindow is not been set correctly, even with 1 finger used. example log:
window = 1[0xa32940] from 1279 205
notifyTouchEvent id=1 state= 812
LensTouchEvent:dispose - LensTouchEvent[view=LensView[nativePtr=0xa23e08],state=812,id=1,x=1279,y=205,absX=1279,absY=205]
EV_ABS ABS_X 9579
EV_ABS ABS_Y 1841
EV_ABS ABS_MT_POSITION_X 9579
EV_ABS ABS_MT_POSITION_Y 1841
EV_ABS ABS_MT_ORIENTATION 0
EV_ABS ABS_MT_TOUCH_MAJOR 423
EV_ABS ABS_MT_TOUCH_MINOR 355
EV_SYN SYN_MT_REPORT 0
EV_SYN SYN_REPORT 0
Number of touch points - pre-existing 1 new 1
pendingTouchPointCount >= touchPointCount
Assigning id 1 to pendingTouchIDs[0] from touchIDs[0]
Update mouse position from touchPoint[0] with id 1 (1277 205)
point 1 sensitivity check -> STILL
all points are STILL - skipping event
EV_ABS ABS_X 9592
EV_ABS ABS_Y 1862
EV_ABS ABS_MT_POSITION_X 9592
EV_ABS ABS_MT_POSITION_Y 1862
EV_ABS ABS_MT_ORIENTATION 0
EV_ABS ABS_MT_TOUCH_MAJOR 423
EV_ABS ABS_MT_TOUCH_MINOR 355
EV_SYN SYN_MT_REPORT 0
EV_SYN SYN_REPORT 0
Number of touch points - pre-existing 1 new 1
pendingTouchPointCount >= touchPointCount
Assigning id 1 to pendingTouchIDs[0] from touchIDs[0]
Update mouse position from touchPoint[0] with id 1 (1279 207)
point 1 sensitivity check -> STILL
all points are STILL - skipping event
EV_ABS ABS_X 9600
EV_ABS ABS_Y 1753
EV_ABS ABS_MT_POSITION_X 9600
EV_ABS ABS_MT_POSITION_Y 1753
EV_ABS ABS_MT_ORIENTATION 0
EV_ABS ABS_MT_TOUCH_MAJOR 423
EV_ABS ABS_MT_TOUCH_MINOR 177
EV_SYN SYN_MT_REPORT 0
EV_SYN SYN_REPORT 0
Number of touch points - pre-existing 1 new 1
pendingTouchPointCount >= touchPointCount
Assigning id 1 to pendingTouchIDs[0] from touchIDs[0]
Update mouse position from touchPoint[0] with id 1 (1280 195)
point 1 sensitivity check -> MOVE
lens_wm_notifyMultiTouchEvent() with:
point 1 / 1 id=1 state=812, x=1280 y=195
window = -1[(nil)] from 1280 195
touch event dropped -> no window
EV_KEY BTN_TOOL_DOUBLETAP 0
EV_KEY BTN_TOUCH 0
EV_SYN SYN_REPORT 0
Number of touch points - pre-existing 1 new 0
All points (2) -> RELEASE
lens_wm_notifyMultiTouchEvent() with:
point 1 / 1 id=1 state=813, x=1280 y=195
window = -1[(nil)] from 1280 195
touch event dropped -> no window
EV_ABS ABS_X 7374
EV_ABS ABS_Y 5024
EV_ABS ABS_MT_POSITION_X 7374
EV_ABS ABS_MT_POSITION_Y 5024
EV_ABS ABS_MT_ORIENTATION 0
EV_ABS ABS_MT_TOUCH_MAJOR 635
EV_ABS ABS_MT_TOUCH_MINOR 355
EV_SYN SYN_MT_REPORT 0
EV_KEY BTN_TOOL_DOUBLETAP 1
EV_KEY BTN_TOUCH 1
EV_SYN SYN_REPORT 0
Number of touch points - pre-existing 0 new 1
no pre-existing touch points
Update mouse position from touchPoint[0] with id 1 (983 558)
point 1 - no match -> PRESSED
lens_wm_notifyMultiTouchEvent() with:
point 1 / 1 id=1 state=811, x=983 y=558
window = 1[0xa32940] from 983 558
notifyTouchEvent id=1 state= 811
EV_ABS ABS_X 7325
LensTouchEvent:dispose - LensTouchEvent[view=LensView[nativePtr=0xa23e08],state=811,id=1,x=983,y=558,absX=983,absY=558]
Exception in thread "JavaFX Application Thread" EV_ABS ABS_MT_POSITION_X 7325
EV_ABS ABS_MT_POSITION_Y 5024
EV_ABS ABS_MT_ORIENTATION 0
java.lang.RuntimeException: Too many touch points reported
This code in edge cases can drop the event because it can't find a window to notify. The dropped event can cause the Java touch point state machine to get confused and throw and exception.
2 reasons for this were identified:
1) lens_wm_notifyMultiTouchEvent always assume pendingPoint[0] is the index point, but the order of the list is random and the '[0]' point can fall outside a window, causing the event to drop
2) it seems that _dragGrabbingWindow is not been set correctly, even with 1 finger used. example log:
window = 1[0xa32940] from 1279 205
notifyTouchEvent id=1 state= 812
LensTouchEvent:dispose - LensTouchEvent[view=LensView[nativePtr=0xa23e08],state=812,id=1,x=1279,y=205,absX=1279,absY=205]
EV_ABS ABS_X 9579
EV_ABS ABS_Y 1841
EV_ABS ABS_MT_POSITION_X 9579
EV_ABS ABS_MT_POSITION_Y 1841
EV_ABS ABS_MT_ORIENTATION 0
EV_ABS ABS_MT_TOUCH_MAJOR 423
EV_ABS ABS_MT_TOUCH_MINOR 355
EV_SYN SYN_MT_REPORT 0
EV_SYN SYN_REPORT 0
Number of touch points - pre-existing 1 new 1
pendingTouchPointCount >= touchPointCount
Assigning id 1 to pendingTouchIDs[0] from touchIDs[0]
Update mouse position from touchPoint[0] with id 1 (1277 205)
point 1 sensitivity check -> STILL
all points are STILL - skipping event
EV_ABS ABS_X 9592
EV_ABS ABS_Y 1862
EV_ABS ABS_MT_POSITION_X 9592
EV_ABS ABS_MT_POSITION_Y 1862
EV_ABS ABS_MT_ORIENTATION 0
EV_ABS ABS_MT_TOUCH_MAJOR 423
EV_ABS ABS_MT_TOUCH_MINOR 355
EV_SYN SYN_MT_REPORT 0
EV_SYN SYN_REPORT 0
Number of touch points - pre-existing 1 new 1
pendingTouchPointCount >= touchPointCount
Assigning id 1 to pendingTouchIDs[0] from touchIDs[0]
Update mouse position from touchPoint[0] with id 1 (1279 207)
point 1 sensitivity check -> STILL
all points are STILL - skipping event
EV_ABS ABS_X 9600
EV_ABS ABS_Y 1753
EV_ABS ABS_MT_POSITION_X 9600
EV_ABS ABS_MT_POSITION_Y 1753
EV_ABS ABS_MT_ORIENTATION 0
EV_ABS ABS_MT_TOUCH_MAJOR 423
EV_ABS ABS_MT_TOUCH_MINOR 177
EV_SYN SYN_MT_REPORT 0
EV_SYN SYN_REPORT 0
Number of touch points - pre-existing 1 new 1
pendingTouchPointCount >= touchPointCount
Assigning id 1 to pendingTouchIDs[0] from touchIDs[0]
Update mouse position from touchPoint[0] with id 1 (1280 195)
point 1 sensitivity check -> MOVE
lens_wm_notifyMultiTouchEvent() with:
point 1 / 1 id=1 state=812, x=1280 y=195
window = -1[(nil)] from 1280 195
touch event dropped -> no window
EV_KEY BTN_TOOL_DOUBLETAP 0
EV_KEY BTN_TOUCH 0
EV_SYN SYN_REPORT 0
Number of touch points - pre-existing 1 new 0
All points (2) -> RELEASE
lens_wm_notifyMultiTouchEvent() with:
point 1 / 1 id=1 state=813, x=1280 y=195
window = -1[(nil)] from 1280 195
touch event dropped -> no window
EV_ABS ABS_X 7374
EV_ABS ABS_Y 5024
EV_ABS ABS_MT_POSITION_X 7374
EV_ABS ABS_MT_POSITION_Y 5024
EV_ABS ABS_MT_ORIENTATION 0
EV_ABS ABS_MT_TOUCH_MAJOR 635
EV_ABS ABS_MT_TOUCH_MINOR 355
EV_SYN SYN_MT_REPORT 0
EV_KEY BTN_TOOL_DOUBLETAP 1
EV_KEY BTN_TOUCH 1
EV_SYN SYN_REPORT 0
Number of touch points - pre-existing 0 new 1
no pre-existing touch points
Update mouse position from touchPoint[0] with id 1 (983 558)
point 1 - no match -> PRESSED
lens_wm_notifyMultiTouchEvent() with:
point 1 / 1 id=1 state=811, x=983 y=558
window = 1[0xa32940] from 983 558
notifyTouchEvent id=1 state= 811
EV_ABS ABS_X 7325
LensTouchEvent:dispose - LensTouchEvent[view=LensView[nativePtr=0xa23e08],state=811,id=1,x=983,y=558,absX=983,absY=558]
Exception in thread "JavaFX Application Thread" EV_ABS ABS_MT_POSITION_X 7325
EV_ABS ABS_MT_POSITION_Y 5024
EV_ABS ABS_MT_ORIENTATION 0
java.lang.RuntimeException: Too many touch points reported