On Tue, 10 Jun 2025 03:21:53 GMT, Michael Strauß <mstra...@openjdk.org> wrote:

> As it turns out, the CSS engine _really_ wants all styleable nodes to be 
> traceable to a single root node. If that's not the case (as in this PR with 
> the overlay buttons), all kinds of things go wrong.
> 
> I've fixed this issue by having the scene's root node be the parent of the 
> scene overlay. Note that only the overlay knows that the scene root is its 
> parent, the scene root has no knowledge of that (i.e. the overlay is not a 
> child of the scene root that you can see with 
> `Parent.getChildrenUnmodifiable()`)
> 
> With this change, the CSS engine works correctly. As a side effect, it now 
> also picks up stylesheets of the root node. This makes it possible to 
> interfere with the internal stylesheets of the button overlay. In order to 
> reduce the chance of that happening, I've renamed all style classes to have 
> the `-FX-INTERNAL-` prefix. This should hopefully make it clear enough that 
> this is not public API.

Confirmed that this change has fixed the issue...

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

PR Comment: https://git.openjdk.org/jfx/pull/1605#issuecomment-2958743960

Reply via email to