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

Tooltips and at least some forms of hover don't work in IntelliJ on 1.6 #4123

Closed
rock3r opened this issue Jan 12, 2024 · 4 comments · Fixed by JetBrains/compose-multiplatform-core#991
Labels
bug Something isn't working desktop IDEA integration input Touch, mouse, keyboard input related layers: popup/dialog project: Jewel

Comments

@rock3r
Copy link
Contributor

rock3r commented Jan 12, 2024

Describe the bug

TooltipArea({ BasicText("Tooltip", Modifier.background(Color.Magenta).padding(8.dp)) }) {
    BasicText("Hover here", Modifier.background(Color.Gray).padding(8.dp))
}

This doesn't show any tooltip in IJ, but works in standalone apps. It looks like in general hover doesn't work in the IDE anymore. Tested on 23.3.2 on macOS.

Affected platforms

  • Desktop

Versions

  • Kotlin version*: 1.8.21
  • Compose Multiplatform version*: 1.6.0-dev1362
  • OS version(s)* (required for Desktop and iOS issues): macOS 14.2.1
  • OS architecture (x86 or arm64): aarch64
  • JDK (for desktop issues): 17.0.9+7-b1087.9 aarch64 OpenJDK 64-Bit Server VM by JetBrains s.r.o.
@rock3r rock3r added bug Something isn't working submitted labels Jan 12, 2024
MatkovIvan added a commit to JetBrains/compose-multiplatform-core that referenced this issue Jan 13, 2024
## Proposed Changes

- Use window coordinates to check if it's in bounds - it's different
after #956

## Testing

Test: run added unit test or the next sample:
```kt
fun main() = SwingUtilities.invokeLater {
    SwingComposeWindow()
}

fun SwingComposeWindow() {
    val window = JFrame()
    window.defaultCloseOperation = WindowConstants.EXIT_ON_CLOSE

    val panel = JPanel()
    panel.layout = GridLayout(2, 1)
    panel.add(JPanel())
    panel.add(ComposePanel().apply {
        setContent {
            ComposeContent(background = Color.Green)
        }
    })
    window.contentPane.add(panel, BorderLayout.CENTER)

    window.setSize(800, 600)
    window.isVisible = true
}

@OptIn(ExperimentalFoundationApi::class)
@composable
fun ComposeContent(background: Color) {
    Box(
        modifier = Modifier.fillMaxSize().background(color = background),
        contentAlignment = Alignment.Center
    ) {

        TooltipArea({ BasicText("Tooltip", Modifier.background(Color.Magenta).padding(8.dp)) }) {
            BasicText("Hover here", Modifier.background(Color.Gray).padding(8.dp))
        }
    }
}
```

## Issues Fixed

Fixes JetBrains/compose-multiplatform#4123
@rock3r
Copy link
Contributor Author

rock3r commented Jan 14, 2024

@MatkovIvan thanks for the super quick fix! Can you let me know when the change ships in a dev build, so I can update the dependency in Jewel?

@MatkovIvan
Copy link
Member

It's already in 1.6.0-dev1369

@rock3r
Copy link
Contributor Author

rock3r commented Jan 14, 2024

@MatkovIvan just tested in Jewel and it seems to fix all issues on my machine! I'm going to release a Jewel version with the fix ASAP. Hopefully this also works for @fscarponi and @lamba92

@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.

@JetBrains JetBrains locked and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working desktop IDEA integration input Touch, mouse, keyboard input related layers: popup/dialog project: Jewel
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants