Skip to content

injector: an absolute pointer position carries its extent - #63

Closed
utkarshdalal wants to merge 1 commit into
masterfrom
absolute-pointer-extent
Closed

utkarshdalal wants to merge 1 commit into
masterfrom
absolute-pointer-extent

Conversation

@utkarshdalal

@utkarshdalal utkarshdalal commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

nativePointerAbsolute now takes (x, y, width, height): the position on a width x height extent that covers the output. The injector passes that extent to the virtual pointer's motion_absolute.

Until now the extent was 0, 0, and wlroots drops a motion_absolute with a zero extent, so an absolute pointer position never reached gamescope.

  • An event with a zero or negative width or height is dropped.
  • A negative x or y is clamped to 0.
  • docs/02-gamenative-drm.md lists the new signature.

Goes with GameNative/gamescope#35 (gamescope handles absolute pointer motion) and utkarshdalal/GameNative#2395 (the app's JNI declaration gains width and height). The app must ship a library built from this branch together with that change: the JNI signature changes.

Checked: cargo test -p gndrm-android (host) and cargo check --target aarch64-linux-android -p gndrm-android.

Device run, Poco F6 (Snapdragon 8s Gen 3), Balatro, 1280x720 container on a 2712x1220 panel (271 px bars left and right), touchscreen mode on, with GameNative/gamescope#35, #63 and utkarshdalal/GameNative#2395 together: taps on menu buttons landed on target after taps in the left bar, the right bar and a swipe that ended in a bar; taps just outside a button edge did not activate it; a card drag in a run worked; no crash or injector error in logcat. Taps were injected with adb (150 ms press). A captured mouse or a controller stick was not tested.

nativePointerAbsolute takes (x, y, width, height): the position on a width x height extent that covers the output. The virtual pointer's motion_absolute now sends that extent instead of 0, 0, which wlroots drops. An event with a zero or negative extent is dropped; a negative coordinate is clamped to 0.
utkarshdalal pushed a commit to utkarshdalal/GameNative that referenced this pull request Nov 10, 2026
… absolute pointer position carries its extent)
@joshuatam
joshuatam deleted the absolute-pointer-extent branch November 16, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant