<@U015TKX93PD> - hopefully <https://github.com/Jet...
# compose-desktop
k
@Igor Demin - hopefully https://github.com/JetBrains/compose-jb/issues/2237 that I just filed can be fixed before 1.2.0 hits the stable release. This is needed to properly support theming (dark or otherwise) without a flash of grey when
ComposePanel
is used.
i
I think, we can try to fix this by 1.2.0 release. But no promises 🙂
k
Cross fingers it makes it into 1.2.0 👀
i
I tried to fix this a few weeks ago, but no luck. Will look at it more closely now. All features are merged, and now we are focused on bugs.
t
I'm using a workaround for macOS, but didn't work for Windows back then. Maybe that helps you point to the underlying issue. https://kotlinlang.slack.com/archives/C01D6HTPATV/p1642214668122500?thread_ts=1638318670.092600&amp;cid=C01D6HTPATV
i
Thanks! But isn't that related to
ComposeWindow
? The issue above is about
ComposePanel
.
ComposeWindow
flashes can be fixed this way:
Copy code
fun main() = SwingUtilities.invokeLater {
    val window = ComposeWindow()
    window.size = Dimension(400, 400)
    window.setContent {
        App()
    }
    window.makeDisplayable()
    window.contentPane.paint(window.graphics)
    window.isVisible = true
}

internal fun Window.makeDisplayable() {
    val oldPreferredSize = preferredSize
    preferredSize = size
    try {
        pack()
    } finally {
        preferredSize = oldPreferredSize
    }
}
And it is used inside Composable
Window
Maybe that helps you point to the underlying issue
Anyway, it seems we can use this for ComposePanel. Worth to try