summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--editor/editor_node.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index dcc9255dc6..fa8810c539 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -5856,6 +5856,14 @@ void EditorNode::add_control_to_dock(DockSlot p_slot, Control *p_control) {
}
void EditorNode::remove_control_from_dock(Control *p_control) {
+ // If the dock is floating, close it first.
+ for (WindowWrapper *wrapper : floating_docks) {
+ if (p_control == wrapper->get_wrapped_control()) {
+ wrapper->set_window_enabled(false);
+ break;
+ }
+ }
+
Control *dock = nullptr;
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
if (p_control->get_parent() == dock_slot[i]) {