Skip to content

Gamescope: touch positions reach the compositor as positions - #2395

Draft
utkarshdalal wants to merge 4 commits into
masterfrom
gamescope-absolute-touch-position
Draft

utkarshdalal wants to merge 4 commits into
masterfrom
gamescope-absolute-touch-position

Conversation

@utkarshdalal

@utkarshdalal utkarshdalal commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Description

Follows #2394 (its commit is the first one here).

In Gamescope mode the app sent every absolute pointer position (a touchscreen tap, an uncaptured mouse) as a relative move from a cursor position it tracked itself. The compositor's cursor can move without the app: it is kept inside the focused window, a window that takes the focus re-centres it, and a game can warp it. After any of these, taps landed off. #2394 covers the black-bar case; a windowed game or a launcher smaller than the screen was still wrong.

Now the position is sent as a position:

  • GamescopeInputSink.pointerMove calls nativePointerAbsolute(x, y, width, height) with the container screen as the extent. The compositor maps it to the focused window.
  • Relative moves (captured mouse, a stick mapped to the mouse, trackpad gestures) are sent as before.
  • The sink no longer keeps a cursor position.

Pending before this can merge:

Recording

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by cubic

Fixes Gamescope-mode taps and uncaptured mouse moves landing off-target after the compositor moves its cursor, by sending positions as positions instead of relative steps from a tracked cursor.

  • Absolute pointer events go out as (x, y) plus screen width and height; the sink no longer keeps a cursor position or sends relative deltas for absolute input.
  • Pan and click-drag gestures now send their step as a step, instead of projecting it from a local cursor copy.
  • The guest pointer is clamped to the screen edges in XServer, so touches in a letterbox bar stop at the edge instead of offsetting later taps.
  • The updated libgamenative_drm.so is included; the gamescope payload change (android: A60, a pointer that reports positions moves the cursor to them GameNative/gamescope#35) is still required before this can merge.

Written for commit 1c3ca42. Summary will update on new commits.

View guided diff Turn on auto-fix

Utkarsh Dalal added 2 commits November 10, 2026 09:58
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

… absolute pointer position carries its extent)
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