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

Alina Chebakova

10/17/2023, 2:23 PM
Hi! How can I do native window management with a custom header on WIndows 11? The built-in functionality from the examples in the github repository does not work correctly: instead of the native full screen, the application simply stretches to the full screen size, because of this, when the "Automatically hide taskbar" setting is enabled and hovering over the taskbar, it does not pop out.
g

Giuliopime

10/18/2023, 5:34 PM
Maybe the second answer of this post? https://stackoverflow.com/questions/11570356/jframe-in-full-screen-java When you create the Window in compose you get a
FrameWindowScope
that you should be able to use for this
Like this
Copy code
val device = GraphicsEnvironment.getLocalGraphicsEnvironment().screenDevices[0];
Window(
        visible = visible,
        onCloseRequest = {
            visible = false
        },
        state = state
    ) {
        Button(onClick = {
            device.fullScreenWindow = this.window;
        }) {
            Text("Full screen")
        }
    }
I have not tested this so it might not work
4 Views