On Thu, 16 Jan 2025 11:12:25 GMT, Jose Pereda <jper...@openjdk.org> wrote:

>> Unfortunately I don't think there is any other way. The `VirtualFlow` needs 
>> two pulses (in real life applications) as the first time, the layout is not 
>> yet correct for some cases (e.g. for `No ScrollBar` -> `ScrollBar`). I even 
>> used some watchpoints to confirm this behavior.
>> 
>> You can see the same thing in the `VirtualFlowTest.setUp` method, which 
>> initializes the flow and does two `pulse` calls after. So I think this is a 
>> premature problem, which probably can be fixed, but more 
>> refactorings/optimzations are needed (some of which I want to file a PR when 
>> I have more time). 
>> Maybe at some point we can completely eliminate this problem, but I don't 
>> think I can do that here in this PR (unless you have an idea, which is very 
>> much welcome!)
>
> Maybe the name `pulse` in the test you point out is misleading, since it 
> actually calls `flow.layout()`, and two layout passes is not the same as two 
> pulses.

That is right, but the `pulse` call will call `layout`, which will call 
`layoutChildren` (when needed). I could also just call `layout` directly, but 
want to keep it the same way as the actual Application would behave.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1644#discussion_r1918345247

Reply via email to