JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.15k stars 1.17k forks source link

SwingPanel is always on the top #3739

Closed MohamedRejeb closed 1 year ago

MohamedRejeb commented 1 year ago

Describe the bug If I use android Views or iOS UIKit interop with Compose the z index is respected and I can have a composable on top of a UIKit View for example but for desktop it's not the case, swing components are always on the top.

Box {
    SwingInterop()
    Text("Demo text") // this text should be visible on top of swing
}

https://github.com/MohamedRejeb/Calf/blob/8dd27303afba2f76503089567ad65ffe94e5a051/calf-ui/src/desktopMain/kotlin/com/mohamedrejeb/calf/ui/web/WebView.desktop.kt#L120

https://github.com/MohamedRejeb/Calf/blob/8dd27303afba2f76503089567ad65ffe94e5a051/sample/common/src/commonMain/kotlin/com.mohamedrejeb.calf.sample/ui/WebViewScreen.kt#L47

Affected platforms

Versions

To Reproduce Steps and/or the code snippet to reproduce the behavior:

  1. Create a Box composable
  2. Add SwingPanel
  3. Add any other composable under the SwingPanel
  4. The composable is not going to be visible

Expected behavior The composable should be on top of the SwingPanel

Additional context In my case I'm using JavaFX WebView, I'm not sure if it's a common problem or related to using JavaFX

MatkovIvan commented 1 year ago

It looks like duplicate of #2926

okushnikov commented 3 months ago

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