On Fri, 16 Oct 2026 19:21:08 GMT, Andy Goryachev <[email protected]> wrote:

>> Marius Hanl has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   more focus
>
> modules/javafx.controls/src/main/java/javafx/scene/control/skin/VirtualFlow.java
>  line 2883:
> 
>> 2881:         }
>> 2882: 
>> 2883:         return getScene().getFocusOwner().getScene() != null;
> 
> a listener might have moved the cell graphics to another scene.  this method 
> will return `true` causing the new code to skip the focus recovery.

This seems to be another case where your 'buddy' did probably tell you that.
Such extreme hypothetical problems do not help to find a good fix. I can also 
ask a buddy myself, but I'm not interested -- I'm interested in other opinions 
and real thoughts into this problem.

We could also add a `visibleProperty` listener, or a `parentProperty` listener 
and shift the focus again and will steal the focus. The previous solution broke 
for all the scenarios while scanning the whole scene tree. This solution will 
at least not steal anything.

As always with properties in JavaFX, we can not rely on any state. Listeners 
can re-modify it, breaking all our assumptions.
It is the same in CSS, which as you know has a fair share of rleated problems.

We can at this point only factor in the happy path and some strange paths, but 
not the super weird hyper hypothetical user may do the weirdest things ever 
scenarios.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2347#discussion_r4298924248

Reply via email to