https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
k

Kirill Grouchnikov

08/09/2022, 10:01 PM
@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

Igor Demin

08/10/2022, 11:57 AM
I think, we can try to fix this by 1.2.0 release. But no promises 🙂
k

Kirill Grouchnikov

08/22/2022, 1:44 PM
Cross fingers it makes it into 1.2.0 👀
i

Igor Demin

09/16/2022, 10:25 AM
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

Thomas

09/16/2022, 10:29 AM
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&cid=C01D6HTPATV
i

Igor Demin

09/16/2022, 10:33 AM
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
9 Views