On Sat, 9 Nov 2024 01:28:53 GMT, Michael Strauß <mstra...@openjdk.org> wrote:

> Implementation of [focus 
> delegation](https://gist.github.com/mstr2/44d94f0bd5b5c030e26a47103063aa29).

modules/javafx.graphics/src/main/java/javafx/scene/Node.java line 8578:

> 8576:     }
> 8577: 
> 8578:     public final void setHoistFocus(boolean value) {

In this PR setting hoistFocus on a control only updates the flag in the control 
itself. What if the control’s skin introduces sub-nodes? I would assume that 
setting hoistFocus on a control would automatically set that flag on the 
control’s entire skin. Is that correct? If so what are the mechanics of making 
that happen?

It seems hoistFocus is serving two roles. One is an optimization so that 
requestFocus knows whether it should walk the scene graph looking for a 
focus-scope node. For that use the flag should be propagated through 
descendants in the graph. But it’s also being proposed as a hoisting barrier 
e.g. when it’s *not* set it prevents focus from hoisting upward even if there's 
a focus-scope node higher up in the graph. But a barrier applies just to a 
single node and should not be propagated. So I’m having a difficult time 
figuring out when and how this flag should be propagated through the tree. But 
I’m no expert on skins so maybe I’m assuming this is more complicated than it 
actually is.

(P.S. I like this PR, it's a huge improvement over what we've got. I'm just 
trying to understand how it all works.)

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1632#discussion_r2205569905

Reply via email to