-
Notifications
You must be signed in to change notification settings - Fork 534
8365637: Unmanaged nodes are not added to the Scene's dirty layout list #1874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back jhendrikx! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
There is a tiny change in the documentation, but it doesn't change the meaning (a scene root is a layout root, and unmanaged nodes are layout roots; there are no other types of layout roots). Can do a CSR though if deemed needed. |
/reviewers 2 |
@andy-goryachev-oracle |
@hjohn would it be possible to add a unit test? |
There is a single word change in the javadoc. Do we need a CSR? |
No. Even for larger doc fixes I never needed one. |
If the node is unmanaged, why does it need a relayout in practice? |
The unmanaged node does not need relayout, but its potentially managed children do. Just like a Scene does not need layout, but its root does. A node being unmanaged affects its parent (the parent must skip it for layout calculations), but does not free it from doing layout on its own children (if I interpret the documentation correctly). Let's take this hierarchy:
The Region will not lay out the stack pane as it is unmanaged, so I position the unmanaged child manually with JavaFX currently will do steps 1 and 2, but does not do step 3:
The documentation however seems quite clear that step 3 is also supposed to be done. |
@arapte Can you review this? |
Does |
After investigation, it seems that SubScene's are considered scene roots, so that would make it a layout root as well. This code in
|
@palexdev You are right, I missed something... thanks for taking an extensive look. My testing branch for this problem has a fix applied for JDK-8360940, but it now looks like that fix is incomplete. What should happen when an unmanaged node is encountered is that changes in any of its children should not require re-layout of its parents (as an unmanaged node, all container parents ignore it and don't take it into account into their computations, so there is no point to re-layout the parents). However, due to a bug, code in So, what it looks like is that this PR and the fix for JDK-8360940 need to be a single PR. Sorry for the bad PR, I will move this to draft and provide a complete fix. |
I've submitted PR #1879 to address the root cause of this issue. It is a much smaller change, but does expose a flaw in how layout flags are managed... see that PR for more details. |
This PR has become irrelevant, will close it for now. |
This PR adds the necessary logic to automatically relayout unmanaged nodes when they're dirty as specified by the documentation. Relevant sections (emphasis mine):
Parent::requestLayout
Node::managedProperty
And:
From this I conclude that:
Parent
), or a Scene's root nodeNote that Scene currently does not have a dirty layout list.
Note also that the documentation for
requestLayout
probably meant to say "scene root or unmanaged" instead of "layout root or unmanaged."Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1874/head:pull/1874
$ git checkout pull/1874
Update a local copy of the PR:
$ git checkout pull/1874
$ git pull https://git.openjdk.org/jfx.git pull/1874/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1874
View PR using the GUI difftool:
$ git pr show -t 1874
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1874.diff
Using Webrev
Link to Webrev Comment