-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[JEWEL-992] Hide mouse cursor while typing in BTF on macOS #3372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[JEWEL-992] Hide mouse cursor while typing in BTF on macOS #3372
Conversation
faogustavo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No blockers :)
3c1838d to
8f771d3
Compare
| import org.jetbrains.skiko.OS | ||
| import org.jetbrains.skiko.hostOs | ||
|
|
||
| internal object StandalonePlatformCursorController : PlatformCursorController { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is copied from platform code, it'd be good to write it in the KDoc
| import org.jetbrains.jewel.ui.platform.PlatformCursorController | ||
|
|
||
| @Composable | ||
| public fun Modifier.hideCursorOnTyping( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make it internal? I don't think people will need to use this directly.
| import androidx.compose.runtime.ProvidableCompositionLocal | ||
| import androidx.compose.runtime.staticCompositionLocalOf | ||
|
|
||
| public interface PlatformCursorController { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add KDoc to all public API symbols
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 controlStandalonePlatformCursorController- macOS implementation using JNA to call[NSCursor setHiddenUntilMouseMoves:YES]BridgePlatformCursorController- Bridge implementation usingMacUIUtil.hideCursor()NoOpPlatformCursorController- Fallback for unsupported platformsIntegration
InputFieldcomponents via.hideCursorOnTyping()modifierLocalPlatformCursorControllercomposition local:IntUiTheme→StandalonePlatformCursorControllerSwingBridgeTheme→BridgePlatformCursorControllerRelease notes
New features