RFR: 8362091: Window title bar should reflect scene color scheme [v2]

Marius Hanl mhanl at openjdk.org
Fri Aug 15 11:51:20 UTC 2025


On Sun, 27 Jul 2025 18:46:46 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> Currently, the color scheme of a system-decorated stage is as follows:
>> * On Windows, the title bar is always light (even if the OS color scheme is dark).
>> * On macOS and Linux, the title bar is light or dark depending on the OS color scheme.
>> 
>> The expected behavior is that the title bar matches the color scheme of the `Scene`.
>> If an application doesn't specify a color scheme, the title bar color should match the OS color scheme.
>> 
>> This PR fixes the behavior for Windows and macOS, but not for Linux (there's no good way to do that).
>> Depending on how you look at it, this is either a bug fix or an enhancement.
>
> Michael Strauß has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:
> 
>  - Merge branch 'master' into feature/dark-window-frame
>    
>    # Conflicts:
>    #	modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.m
>  - Window decorations adapt to color scheme

modules/javafx.graphics/src/main/native-glass/win/GlassWindow.cpp line 1267:

> 1265:     // value 0 to indicate that we don't support this feature.
> 1266:     // See: https://github.com/MicrosoftDocs/sdk-api/commit/c19f1c8a148b930444dce998d3c717c8fb7751e1
> 1267:     static const DWORD DWMWA_USE_IMMERSIVE_DARK_MODE = []() {

This implementation looks correct. For comparison, I checked out the implementation in `Godot`.

Version check: https://github.com/godotengine/godot/blob/master/platform/windows/display_server_windows.cpp#L6853 
Set the attribute: https://github.com/godotengine/godot/blob/master/platform/windows/display_server_windows.cpp#L4708

Note that the `build` numbers differ a little bit from here. But checking your linked commit, your numbers seem to be the right one! Will do some testing later (on Windows 11).

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1845#discussion_r2278857413


More information about the openjfx-dev mailing list