kirill-grouchnikov / aurora

Building modern, elegant and fast desktop Compose applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Window] WindowPlacement.Maximized makes undecorated window fullscreen

russellbanks opened this issue · comments

Bug Description

On an undecorated window, using WindowPlacement.Maximized makes the the window fullscreen, when it should be maximised.

Reproducer

fun main() = auroraApplication {
    AuroraWindow(
        skin = geminiSkin(),
        onCloseRequest = ::exitApplication,
        state = WindowState(placement = WindowPlacement.Maximized),
        undecorated = true
    ) { }
}

Actual Result:

The window becomes fullscreen.

Expected Result:

The window should be maximised (staying above the taskbar).

Platform Info

Aurora Version: Tested on both 1.1.0 & 1.2-SNAPSHOT

Operating System: Windows 11

I don't think I have anything during the initialization of windows about the state, just passing it to the core compose Window composable.

I do have a workaround for the core Swing bug for maximized windows not respecting the screen insets though. Maybe that can be applied during initialization as well. But it feels like that should be done at the Compose level so that it's not an Aurora-only fix.

@russellbanks - do you see the same incorrect behavior if you use the core application and Window composables?

Indeed:

fun main() = application {
    Window(
        onCloseRequest = ::exitApplication,
        state = WindowState(placement = WindowPlacement.Maximized),
        undecorated = true
    ) { }
}

Shows the same issue - maximized treated as fullscreen

I've just had a look and I guess this links back to #1724 and #1553 on compose-jb

I'm not even sure that I can work around this without causing an extra frame of flicker from fullscreen to maximized mode on initialization. Probably the safest (but a bit cumbersome) is to use the code suggested on that second issue.