On Tue, 24 Mar 2026 20:40:59 GMT, Martin Fox <[email protected]> wrote:

> That PR might be missing some common cases. For example, a developer may want 
> the scene's fill color to track the background color in PlatformPreferences. 
> When that pref changes and becomes the new fill we should make sure the color 
> (which is opaque) gets sent on to the OS.

What's missing? When either `Scene.fill` or `Preferences.colorScheme` changes, 
the window background color is updated and sent to the OS (see `WindowStage` 
lines 109, 117).

> It also bothers me that a developer has to rely solely on our built-in 
> heuristics when the scene's fill is an image. What if a developer wants to 
> specify a better color directly? Would it make sense to add a field to 
> ImagePattern (perhaps using the heuristic in this PR as a fallback)? Or maybe 
> provide a public API for setting the window's background color independently 
> of the scene's fill?
> 
> I like that this PR tries to make JavaFX apps look good by default but we 
> should at least think about providing API's so a motivated developer can 
> solve the problem directly and not rely on our heuristics.

If a developer wants to specify their own color, they can surely just set the 
scene fill to exactly that color, and then place a layout container with an 
`ImagePattern` background at the root of the scene graph. Nothing here seems to 
complicated that it would warrant new API.

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

PR Comment: https://git.openjdk.org/jfx/pull/2068#issuecomment-4121451361

Reply via email to