compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

Allow z-ordering with Swing interop

Open rock3r opened this issue 2 years ago • 2 comments

Interop with Swing means any Swing content embedded in a Compose panel will always be at the top (max z-order). Content should be composited with the right z-order instead.

rock3r avatar Mar 27 '23 10:03 rock3r

Is this issue related: https://github.com/JetBrains/compose-multiplatform/issues/1521

mahozad avatar Apr 03 '23 14:04 mahozad

Yes it is in the premise, but that user then talks about issues with (lack of) recomposition when applying a workaround to try and solve the root problem, the lask of z-ordering APIs. The core issue has not been solved yet, as the documentation states:

A SwingPanel is a wrapper that controls the size, position and rendering of a Swing component that is placed on top of a Compose Multiplatform component, meaning the component inside a SwingPanel will always be on top of the Compose in depth. Anything that is misplaced and rests on the SwingPanel will be clipped by the Swing component placed there, so try to think about these situations, and if there is such a risk, then it is better to either redesign the UI accordingly, or stop using the SwingPanel and still try to implement the missing component, thereby contributing to the development of technology and making life easier for other developers.

From here

rock3r avatar Apr 03 '23 14:04 rock3r

:scream: The issue makes AlertDialog(KMP 1.5) can not use with Swing too

xinkunZ avatar Sep 14 '23 09:09 xinkunZ

Partially fixed in https://github.com/JetBrains/compose-multiplatform-core/pull/915. That change doesn't fix "z-order" itself, but changes a way to "clip the hole" for an interop component, so the content above it won't be affected anymore.

MatkovIvan avatar Nov 24 '23 20:11 MatkovIvan