Skip to content

Fix oversized mouse cursor on Android - #300

Draft
4Luke4 wants to merge 1 commit into
localdesktop:mainfrom
4Luke4:agent/fix-android-software-cursor
Draft

Fix oversized mouse cursor on Android#300
4Luke4 wants to merge 1 commit into
localdesktop:mainfrom
4Luke4:agent/fix-android-software-cursor

Conversation

@4Luke4

@4Luke4 4Luke4 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

Use a compact application-owned Android pointer icon while the Local Desktop Wayland frontend is active, instead of inheriting the device's system pointer presentation.

Root cause

Local Desktop currently leaves pointer rendering entirely to Android. As a result, the pointer size follows Android's system and accessibility settings, which can produce a cursor that is disproportionately large for the nested desktop surface.

What changed

  • Embed a small, high-contrast arrow cursor as a PNG resource in the Android runtime code.
  • Decode it through Android's BitmapFactory and construct a custom PointerIcon with an explicit hotspot.
  • Apply the custom icon to the activity decor view when the Wayland frontend resumes.
  • Restore Android's default pointer behavior when the frontend is suspended.
  • Treat JNI failures as recoverable and log a warning rather than disrupting startup.

User impact

External mice and touchpads now use a consistently sized cursor inside Local Desktop, independent of the Android "Large mouse pointer" setting.

Validation

  • Branch is based directly on current upstream main (fe3607c).
  • Diff is limited to src/android/app/run.rs.
  • JNI signatures correspond to:
    • BitmapFactory.decodeByteArray(byte[], int, int)
    • PointerIcon.create(Bitmap, float, float)
    • View.setPointerIcon(PointerIcon)

Device-level validation is still required because the current execution environment does not include the Android SDK, Rust toolchain, or emulator.

Fixes #278

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.

Mouse cursor too large.

1 participant