fix(input): move the guest pointer on a suppressed direct tap

This commit is contained in:
Kurt Himebauch committed 2026-11-16 05:36:36 +00:00
1 parent 7394f69b81
commit 6f04166dbd
2 files changed
+11 -1

No files matched your search

@@ -4917,7 +4917,11 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
return true
}
if (event.actionMasked == MotionEvent.ACTION_DOWN) {
if (!pointerLocked) showCursor(event.x.coerceIn(rect.left, rect.right), event.y.coerceIn(rect.top, rect.bottom))
if (!pointerLocked) {
val x = event.x.coerceIn(rect.left, rect.right)
val y = event.y.coerceIn(rect.top, rect.bottom)
if (directTouchHold.tapClicks) showCursor(x, y) else movePointer(x, y)
}
if (WaylandCompositor.nativeFocusTakesTouch()) {
listOf(PointerGestures.BTN_LEFT, PointerGestures.BTN_RIGHT, PointerGestures.BTN_MIDDLE).forEach {
heldButtons.set(1, it, false)
@@ -303,10 +303,14 @@ class SessionGestureRoutingTest {
shadowOf(Looper.getMainLooper()).idleFor(Duration.ofMillis(200))
return directTouches.size
}
CompositorShadow.pointerMoves.clear()
assertEquals(1, tapWith(InputProfile.defaults(InputProfile.DESKTOP)))
assertTrue(CompositorShadow.pointerMoves.isEmpty())
assertEquals(0, tapWith(InputProfile.defaults(InputProfile.DESKTOP)
.withBinding(InputRole.PRIMARY, InputControl.A, InputAction.MouseButton(274))))
assertEquals(1, CompositorShadow.pointerMoves.size)
assertEquals(1, tapWith(InputProfile.defaults(InputProfile.DESKTOP)))
assertEquals(1, CompositorShadow.pointerMoves.size)
}
private fun tapThreeFingers(expectSteamGesture: Boolean) {
@@ -337,7 +341,9 @@ class SessionGestureRoutingTest {
class CompositorShadow {
companion object {
@JvmStatic var sceneInputs = 0
@JvmStatic val pointerMoves = mutableListOf<Pair<Int, Int>>()
@JvmStatic @Implementation fun __staticInitializer__() {}
@JvmStatic @Implementation fun nativeSendPointer(action: Int, x: Int, y: Int) { pointerMoves += x to y }
@JvmStatic @Implementation fun nativeSendTouch(action: Int, id: Int, x: Int, y: Int) {}
@JvmStatic @Implementation fun nativeSendSceneInput(type: Int, code: Int, value: Int) { sceneInputs++ }
}