Skip to content

Commit 819b69f

Browse files
committed
Editor: Fix infinite appending of docks without slots to config
Docks without default slots (index -1, config key "dock_0") were being infinitely appended to the editor layout config because this special slot was never cleared before saving, unlike regular dock slots. This adds code to explicitly clear the dock_0 config key before saving closed docks, preventing infinite appending.
1 parent 7ed0b61 commit 819b69f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

editor/docks/editor_dock_manager.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,13 @@ void EditorDockManager::save_docks_to_config(Ref<ConfigFile> p_layout, const Str
600600
}
601601
}
602602

603+
// Clear the special dock slot for docks without default slots (index -1 = dock_0).
604+
// This prevents closed docks from being infinitely appended to the config on each save.
605+
const String no_slot_config_key = "dock_0";
606+
if (p_layout->has_section_key(p_section, no_slot_config_key)) {
607+
p_layout->erase_section_key(p_section, no_slot_config_key);
608+
}
609+
603610
// Save docks in windows.
604611
Dictionary floating_docks_dump;
605612
for (WindowWrapper *wrapper : dock_windows) {

0 commit comments

Comments
 (0)