Skip to content

Conversation

@wellingtoncosta
Copy link
Collaborator

@wellingtoncosta wellingtoncosta commented Jan 6, 2026

Summary

Implements cursor hiding behavior on macOS when typing in text fields, matching the native IDE behavior. The cursor automatically hides when the user types and reappears when the mouse moves.

Evidence

Screen.Recording.2026-01-06.at.6.37.57.PM.mov

Implementation Details

Architecture

Added a platform-specific cursor controller abstraction using Compose composition locals:

  • PlatformCursorController - Interface for platform-specific cursor control
  • StandalonePlatformCursorController - macOS implementation using JNA to call [NSCursor setHiddenUntilMouseMoves:YES]
  • BridgePlatformCursorController - Bridge implementation using MacUIUtil.hideCursor()
  • NoOpPlatformCursorController - Fallback for unsupported platforms

Integration

  • Applied to all InputField components via .hideCursorOnTyping() modifier
  • Only active when field is enabled and not read-only
  • Provided via LocalPlatformCursorController composition local:
    • IntUiThemeStandalonePlatformCursorController
    • SwingBridgeThemeBridgePlatformCursorController

Release notes

New features

  • Input Fields: Added automatic cursor hiding on macOS when typing. The cursor hides while typing and reappears when the mouse moves, matching the native macOS behavior seen in IntelliJ Platform text fields (JEWEL-992).

Note

Implements macOS cursor-hiding behavior and abstracts platform-specific control.

  • Adds PlatformCursorController and LocalPlatformCursorController composition local
  • macOS implementations: BridgePlatformCursorController (uses MacUIUtil.hideCursor()), StandalonePlatformCursorController (uses JNA to call [NSCursor setHiddenUntilMouseMoves:])
  • Themes provide the controller: SwingBridgeThemeBridgePlatformCursorController, IntUiThemeStandalonePlatformCursorController
  • Integrates with InputField via .hideCursorOnTyping() (key preview on keydown; active only when enabled and not read-only)
  • Build: adds JNA dependency to standalone module (Bazel/Gradle); API dump updated

Written by Cursor Bugbot for commit fbc46c1. This will update automatically on new commits. Configure here.

Copy link
Collaborator

@faogustavo faogustavo left a comment

Choose a reason for hiding this comment

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

No blockers :)

@wellingtoncosta wellingtoncosta force-pushed the wp/hide-cursor-while-typing-macos branch from 3c1838d to 8f771d3 Compare January 7, 2026 14:34
@wellingtoncosta wellingtoncosta force-pushed the wp/hide-cursor-while-typing-macos branch from 8f771d3 to e3fc7bf Compare January 13, 2026 22:27
@wellingtoncosta wellingtoncosta force-pushed the wp/hide-cursor-while-typing-macos branch from e3fc7bf to cd4537d Compare January 13, 2026 22:33
Copy link
Collaborator

@rock3r rock3r left a comment

Choose a reason for hiding this comment

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

Nice work! Couple minor notes

@wellingtoncosta wellingtoncosta force-pushed the wp/hide-cursor-while-typing-macos branch from cd4537d to f5f2c94 Compare January 14, 2026 13:09
Copy link
Collaborator

@rock3r rock3r left a comment

Choose a reason for hiding this comment

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

Thank you!

@wellingtoncosta wellingtoncosta force-pushed the wp/hide-cursor-while-typing-macos branch from f5f2c94 to fbc46c1 Compare January 15, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants