On Mon, 16 Feb 2026 17:11:01 GMT, Michael Strauß <[email protected]> wrote:

>> When a non-opaque scene fill color is used with a stage style other than 
>> `StageStyle.TRANSPARENT`, the actual fill color is always white. This 
>> doesn't work well when the scene uses a dark color scheme. A practical 
>> solution is to allow non-opaque scene fill colors, and blend them on top of 
>> a white or black background (depending on color scheme) to derive an opaque 
>> color that adapts intuitively to the color scheme.
>> 
>> To test this, simply create a scene that uses a non-opaque fill color and 
>> observe the scene background when the color scheme is changed.
>> 
>> This PR includes a system test, run it with:
>> 
>> ./gradlew -PFULL_TEST=true -PUSE_ROBOT=true :systemTests:test --tests 
>> test.robot.javafx.scene.SceneFillTest.testSceneFill
>
> Michael Strauß has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   import

modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
 line 116:

> 114:                 .flatMap(Scene::fillProperty)
> 115:                 .subscribe(() -> {
> 116:                     QuantumToolkit.getToolkit().checkFxUserThread();

This isn't working reliably for me. I have a test app that sets the scene's 
fill to different Colors. The first time I set the fill this line is triggered 
but after that it doesn't fire even though the scene's fill property is being 
invalidated.

If I change this to `fxStage.getScene().fillProperty().subscribe(() -> {});` it 
works consistently.

modules/javafx.graphics/src/main/java/com/sun/javafx/util/Utils.java line 244:

> 242:             }
> 243: 
> 244:             case ImagePattern pattern -> 
> ImageUtils.computeDominantColor(pattern.getImage(), background);

I know JavaFX has the notion of background image loading. Is that relevant 
here? This code is changing the timing; it will access the image's pixels 
before the stage is even shown instead of waiting for a render pass.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2068#discussion_r2984647609
PR Review Comment: https://git.openjdk.org/jfx/pull/2068#discussion_r2984712224

Reply via email to