Skip to content
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

Remove more AWT related code #1736

Closed
smallshen opened this issue Jan 22, 2022 · 2 comments
Closed

Remove more AWT related code #1736

smallshen opened this issue Jan 22, 2022 · 2 comments
Assignees
Labels

Comments

@smallshen
Copy link

The rememberCursorPositionProvider only uses a few awt related things but breaks a lot of compatibility.

val component = LocalLayerContainer.current
val cursorPoint = remember {
    val awtMousePosition = MouseInfo.getPointerInfo().location
    convertPointFromScreen(awtMousePosition, component)
    IntOffset(
        (awtMousePosition.x * component.density.density).toInt(),
        (awtMousePosition.y * component.density.density).toInt()
    )
}

It will break the tooltip, cursor position popup.
It breaks when using OpenGL or another non awt environment with ComposeSence.

HumbleUI/JWM#172

Can we have a LocalMouseLocationProvider with CompositionLocal and set defaults to the code above in rememberCursorPositionProvider?

related to: #652

@Walingar
Copy link
Collaborator

Walingar commented May 4, 2023

In 1.4.0 rememberCursorPositionProvider doesn't rely on AWT anymore, so it should fine with non-awt environment

@okushnikov
Copy link
Collaborator

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants