RFR: 8359599: Calling refresh() for all virtualized controls recreates all cells instead of refreshing the cells [v2]
Johan Vos
jvos at openjdk.org
Sun Oct 12 17:46:42 UTC 2025
On Sat, 4 Oct 2025 04:28:19 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:
> Every `refresh()` will trigger 2 layouts for some reason, where the second one does nothing as nothing is dirty, so basically a noop. I can have a look into that (maybe as a follow up?) but I remember that this happens sometimes in general for the `VirtualFlow` and we should check that generally at one point.
This is something that worries me. One of the main issues I see with e.g. VirtualFlow, is that some methods can be invoked both during a rendering pulse as well as (indirectly) via explicit invocations, most often by code invoked with Platform.runLater().
Depending on whether code is called during a pulse or not, the behavior can be very different. A major problematic consequence of a method that used to be called outside the pulse, and that is now for some reason (e.g. due to concurrency, as it depends whether the Runnable submitted to Platform.runLater() is executed before or after the pulse) called during a pulse, is that this can lead to flickering. If `requestNextPulse` is called during the layout phase, it is very well possible that a "wrong" layout is rendered briefly before the correct layout is shown.
I am not saying that this PR makes the situation worse or better, but I think there is a reasonable chance that some applications will behave differently (and show flickering). Having said that, I don't think that this PR can be blamed in case there is a different behavior.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1830#issuecomment-3395041542
More information about the openjfx-dev
mailing list