On Wed, 16 Apr 2025 10:31:50 GMT, Michael Strauß <mstra...@openjdk.org> wrote:

> A listener that is added to `Parent.needsLayoutProperty()` may see a wrong 
> value when calling `Parent.isNeedsLayout()` from the callback. The fix is to 
> apply the value before notifying the listeners.

modules/javafx.graphics/src/main/java/javafx/scene/Parent.java line 996:

> 994:         // Needs to be set before needsLayout is updated, as otherwise a 
> listener that
> 995:         // calls isNeedsLayout() might see the old value.
> 996:         layoutFlag = flag;

This is the right change, but I suspect it might cause regression.

The JavaFX entities which call `isNeedsLayout()`:

`VirtualFlow::layoutChildren`
`VirtualFlow::setCellIndex`

We may need to focus on List/Table/Tree/TableViews during testing.

(Anecdata: I've seen continuous layout calls in the TableView before)

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1781#discussion_r2047370606

Reply via email to