RFR: 8313956: focusWithin on parents of a newly-added focused node is not updated [v4]
Andy Goryachev
angorya at openjdk.org
Fri Aug 18 21:08:36 UTC 2023
On Fri, 18 Aug 2023 20:45:00 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
>> This PR fixes an issue with the way `focusWithin` bits are adjusted in the scene graph. Previously, the `focusWithin` counts of all parents of a removed node would be decreased if the removed node has a non-zero `focusWithin` count. This PR adds logic for the opposite scenario: the `focusWithin` count is increased on all parents of a newly-added node that is already focused (or contains other focused nodes).
>
> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
>
> Changes per review
modules/javafx.graphics/src/main/java/javafx/scene/Node.java line 8190:
> 8188: Node node = oldParent;
> 8189: while (node != null) {
> 8190: node.focusWithin.adjust(-focusWithin.count);
suppose we are removing a Pane with a bunch of Nodes in it that have non-zero focusWithin.count values.
the parent of said Pane gets a zero count (which is correct), whereas the children of said Pane have their counts unchanged (I assume).
what happens when the same Pane gets added back to the scene graph? wouldn't we enter an inconsistent state?
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1210#discussion_r1298865581
More information about the openjfx-dev
mailing list