Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i change the default window dimensions for Kotlin Compose Desktop?

I want to change the size of the window of my Kotlin Compose Desktop application so when it launches its 720p instead of the odd square it is by default. How can i do that?

I have tried this and have looked it up to no avail

fun FrameWindowScope.setMinSize() {
    window.minimumSize = Dimension(1280, 720)
}
like image 248
Caleb Avatar asked Dec 31 '25 06:12

Caleb


1 Answers

You can simply do it like that:

    val state = rememberWindowState(
        width = 300.dp,
        height = 600.dp,
    )
    Window(
        onCloseRequest = ::exitApplication,
        title = "AppName",
        state = state
    ) {
        App()
    }
like image 178
Mohamed Mabrouki Avatar answered Jan 03 '26 12:01

Mohamed Mabrouki



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!