Skip to content

Commit

Permalink
Merge pull request #22502 from ccordoba12/issue-22494
Browse files Browse the repository at this point in the history
PR: Reset `undocked before hiding` state of all plugins before applying layout
  • Loading branch information
ccordoba12 authored Sep 14, 2024
2 parents 2d2e0a9 + d80d2c0 commit 1aaa4a2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spyder/plugins/layout/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def set_main_window_layout(self, main_window, dockable_plugins):
# is applied
base_plugins_to_hide = []

# Before applying a new layout all plugins need to be hidden
# Actions to be performed before applying the layout
for plugin in dockable_plugins:
all_plugin_ids.append(plugin.NAME)

Expand All @@ -367,6 +367,14 @@ def set_main_window_layout(self, main_window, dockable_plugins):
):
external_plugins_to_show.append(plugin.NAME)

# Restore undocked_before_hiding state so that the layout is
# applied as expected, i.e. all plugins are shown in their expected
# positions. It also avoids an error that leaves the main window in
# an inconsistent state.
# Fixes spyder-ide/spyder#22494
plugin.set_conf('window_was_undocked_before_hiding', False)

# Hide all plugins
plugin.toggle_view(False)

# Add plugins without an area assigned to the default area and made
Expand Down

0 comments on commit 1aaa4a2

Please sign in to comment.