Skip to content

fix: release pointer capture when container exits#705

Merged
utkarshdalal merged 1 commit intoutkarshdalal:masterfrom
AndreVto:release-mouse-capture
Mar 4, 2026
Merged

fix: release pointer capture when container exits#705
utkarshdalal merged 1 commit intoutkarshdalal:masterfrom
AndreVto:release-mouse-capture

Conversation

@AndreVto
Copy link
Copy Markdown
Contributor

@AndreVto AndreVto commented Mar 3, 2026

fix mouse being invisible after exiting container
no need to check if a pointer is captured to begin with, calling releasePointerCapture does nothing if that's the case, per documentation (https://developer.android.com/reference/android/view/View#releasePointerCapture())


Summary by cubic

Release pointer capture when the XServer container exits to prevent the mouse cursor from staying invisible after closing the container.

  • Bug Fixes
    • Always call touchpadView.releasePointerCapture() in exit(); it's a safe no-op if nothing is captured.

Written for commit fb049ea. Summary will update on new commits.

Summary by CodeRabbit

  • Bug Fixes
    • Ensured touchpad pointer capture is properly released when the application exits, preventing potential pointer input issues.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08a27a8 and fb049ea.

📒 Files selected for processing (1)
  • app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt

📝 Walkthrough

Walkthrough

A pointer capture release operation was added to the application exit handler in XServerScreen. The change releases pointer capture on the touchpad view during cleanup when the application terminates.

Changes

Cohort / File(s) Summary
Pointer Capture Cleanup
app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt
Added releasePointerCapture() call on touchpad view during application exit cleanup.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

🐰 A pointer released with graceful care,
As screens grow dark and exit's near,
The touchpad rests, its claim is fair,
Until the app returns next year!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: release pointer capture when container exits' directly and clearly describes the main change made in the pull request - adding a call to release pointer capture during application exit.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@Unnvaldr
Copy link
Copy Markdown
Contributor

Unnvaldr commented Mar 3, 2026

Why add a release function* in an activity higher up in the hierarchy, when you can add it at the same level where request happens?

@utkarshdalal utkarshdalal merged commit 5bbcee2 into utkarshdalal:master Mar 4, 2026
3 checks passed
ObfuscatedVoid pushed a commit to ObfuscatedVoid/GameNative that referenced this pull request Mar 4, 2026
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.

3 participants