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

Update SwingInteropContainer.placeInteropAbove when the renderApi changes #1913

Merged
merged 1 commit into from
Mar 11, 2025

Conversation

m-sasha
Copy link
Member

@m-sasha m-sasha commented Mar 11, 2025

When renderApi changes, update SwingInteropContainer.placeInteropAbove and possibly reposition the interop views accordingly.

Fixes https://youtrack.jetbrains.com/issue/CMP-7746/SwingPanels-placed-incorrectly-on-Windows-if-Direct3D-is-unsupported

Testing

Tested manually by making renderApi mutable and then putting

init {
    thread {
        while (true) {
            Thread.sleep(5000)
            println("Setting render API to OpenGL")
            renderApi = GraphicsApi.OPENGL
            Thread.sleep(5000)
            println("Setting render API to Direct3D")
            renderApi = GraphicsApi.DIRECT3D
        }
    }
}

in ComposeSceneMediator.desktop.kt.
Then running the InteropOrder demo and playing with the colored squares (don't forget to also set compose.interop.blending=true).

Release Notes

Fixes - Desktop

  • [Swing Interop] Fixed compose.interop.blending=true completely breaking Swing interop on Windows when Direct3D is unsupported. Note that interop blending is still supported on Windows only if Direct3D is available.

@m-sasha m-sasha requested a review from MatkovIvan March 11, 2025 09:20
@m-sasha m-sasha force-pushed the m-sasha/update-placeInteropAbove-at-runtime branch 2 times, most recently from 388b23c to c570248 Compare March 11, 2025 10:00
@m-sasha m-sasha requested a review from MatkovIvan March 11, 2025 10:16
Copy link
Member

@MatkovIvan MatkovIvan left a comment

Choose a reason for hiding this comment

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

A few nitpicks, lgtm in general

@m-sasha m-sasha force-pushed the m-sasha/update-placeInteropAbove-at-runtime branch from c570248 to 4cd6d11 Compare March 11, 2025 10:51
@m-sasha m-sasha merged commit f56b68b into jb-main Mar 11, 2025
8 checks passed
@m-sasha m-sasha deleted the m-sasha/update-placeInteropAbove-at-runtime branch March 11, 2025 19:46
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.

None yet

2 participants