On Thu, 18 Jun 2026 15:22:54 GMT, Michael Strauß <[email protected]> wrote:
>> modules/javafx.graphics/src/main/java/com/sun/javafx/scene/SceneContext.java
>> line 130:
>>
>>> 128: @Override
>>> 129: protected void onInvalidated() {
>>> 130: if (scene.getWindow() instanceof Stage stage) {
>>
>> question: if the Scene had the colorScheme property set before it's added to
>> a Stage, will the stage color scheme be updated correctly?
>
> Yes, the actual scene color scheme is queried unconditionally just before the
> stage is shown in `Stage.isHeaderButtonDarkStyle()`. The
> `StageHelper.notifyColorSchemeChanged()` path is only relevant if the scene
> color scheme is changed while the stage is showing.
~~While its true that the mechanism will work when initially setting a scene on
a stage and then showing that stage, it will fail when switching to a new scene
on a stage that is already showing a different scene.~~
UPDATE: between the time I wrote this (then pending) comment and now, I see
that you pushed a new update that changes the way this is done. I can confirm
that this is now fixed.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2188#discussion_r3515652927