Skip to content

Don't rely on AWT in rememberCursorPositionProvider#432

Merged
Nikolai Rykunov (Walingar) merged 2 commits into
jb-mainfrom
nr/tooltip-without-awt
Mar 22, 2023
Merged

Don't rely on AWT in rememberCursorPositionProvider#432
Nikolai Rykunov (Walingar) merged 2 commits into
jb-mainfrom
nr/tooltip-without-awt

Conversation

@Walingar

@Walingar Nikolai Rykunov (Walingar) commented Mar 10, 2023

Copy link
Copy Markdown

Proposed Changes

  • Introduces internal LocalPointerPositions that provides a way to get the current position of pointers. It is used in rememberCursorPositionProvider
  • rememberCursorPositionProvider doesn't rely on AWT anymore
  • Add tests for this functionality

Testing

Test: newly introduced TooltipAreaTest and DesktopCursorPositionTest

Issues Fixed

Fixes: JetBrains/compose-multiplatform#2821

)
}
val pointerPositions = LocalPointerPositions.current
val cursorPoint = remember { pointerPositions.entries.first().value.round() }

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

In the future when Igor Demin (@igordmn) will merge his changes about multi-touch support, we can filter by mouse here.

Comment thread compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/ComposeScene.skiko.kt Outdated
Comment thread compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/ComposeScene.skiko.kt Outdated
…ts instead

To implement it current pointer positions should be provided.
Add test for rememberCursorPositionProvider.

Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
@Walingar

Nikolai Rykunov (Walingar) commented Mar 20, 2023

Copy link
Copy Markdown
Author

Rebased on Sasha's changes (squashed my commits into one), also removed some redundant waits. Some waits are still needed

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.

rememberCursorPositionProvider - get rid of the dependency on AWT

3 participants