-
Notifications
You must be signed in to change notification settings - Fork 105
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
Timing issue setting floating property on undock #35
Comments
Hrm, this definitely seems undesirable as I was actually going to rely on what you described in order to update DockFX for Java 9. I don't see yet why this is delayed, because as soon as the drag is detected on the title bar the dock node is set to floating:
Which causes the floating property to be set to true: DockFX/src/main/java/org/dockfx/DockNode.java Line 285 in 8d44134
|
Possibly because in Docknode you are undocking (setting the dockedProperty) at line 246 and not setting the floatingProperty until line 285. Therefore the dockedProperty changelistener is being fired before the floating property is updated. |
Alright, I'll see if I can push a patch for it shortly without causing a regression. Thank you for finding that. |
Thanks very much, and not a problem |
While I'm going to be addressing this, I want to perhaps look at this another way. I think it may be confusing that I have both So considering this, would you be alright with me combining the docked and floating properties together into one? I would deprecate one and continue use of the other. I think that would make the API less confusing as well as fix this issue too. |
The only problem I could see then is that it would not be possible to tell if the dockpane was not visible (Closed). |
I believe the visible property should take care of that, right? But now that you mentioned it, I believe I may want to change the behavior of close as well so that it does effect the visible property. As I have it now, I was only binding the close button to the visible property, but close itself should set it false, in case the dock node is closed by something other than the close button:
So I will make these two changes then, I will be deprecating the floating property and changing close to always set visible to false. |
OK, sounds good to me. |
Alright, I've patched the issue: e66e091 To avoid breaking any existing users over something trivial, I simply decided to go with the first fix you suggested, to set the floating property before undocking. I've also generated a new beta release with the fix: |
Yes that got it, thanks. |
If I set a listener on the dockedProperty and undock a dock by dragging it, and in the listener test the floatingProperty it is still set to false.
This causes a problem as I want to know if the undocked dock is actually floating or closed (as in not floating and not docked.).
If I check the floatingProperty in a runLater sub it has correctly changed to true
The text was updated successfully, but these errors were encountered: