Remove extra NOTIFICATION_VISIBILITY_CHANGED notifications in docks#113070
Conversation
NOTIFICATION_VISIBILITY_CHANGED notifications in docksNOTIFICATION_VISIBILITY_CHANGED notifications in docks
|
Something bad is happening when you close Scene dock in right UR slot: godot.windows.editor.dev.x86_64_ygLeHgtF2d.mp4It's somewhat reproducible without this PR, but it's not as extreme. |
|
I realized a major flaw in EditorDockManager. |
150c8ea to
62eeecd
Compare
|
I made it so that the When testing I came across this error when I clicked Edit: Nevermind it's happening when you stop hovering over a menu item so very unrelated |
|
Thanks! |
See #113034 (comment)
Related: #113024
When upgrading docks to the new system, I first noticed that docks treated the
NOTIFICATION_{ENTER, EXIT}_TREElike constructors and destructors, only being called once. When they used theEditorBottomPanel, this was valid, but now that they use theEditorDockManager, this is no longer true. Thus, any actions that must be done once, should be moved.In #113034 (comment), the underlying bug was a case where
NOTIFICATION_VISIBILITY_CHANGEDwas used to know when the panel was enabled or disabled. This is valid if the notification only happened when both the enabled and visible, and disabled and not visible. However, due to an ordering issue withEditorDockManager, theNOTIFICATION_VISIBILITY_CHANGED(true)was emitted when closing the dock, andNOTIFICATION_VISIBILITY_CHANGED(false)was emitted when opening the dock, leading to incorrect assumptions.This PR swaps the order of operations so that the notification is only emitted correctly, to preserve assumptions. This has the benefit of removing unnecessary operations when opening and closing docks.
EditorDock::open()EditorDock::close()NOTIFICATION_EXIT_TREE
NOTIFICATION_VISIBILITY_CHANGED
NOTIFICATION_ENTER_TREE
NOTIFICATION_VISIBILITY_CHANGED
NOTIFICATION_VISIBILITY_CHANGED
NOTIFICATION_VISIBILITY_CHANGED
NOTIFICATION_ENTER_TREE
NOTIFICATION_VISIBILITY_CHANGED
NOTIFICATION_ENTER_TREE
NOTIFICATION_VISIBILITY_CHANGED
NOTIFICATION_EXIT_TREE
NOTIFICATION_ENTER_TREE