Skip to content
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

PR: Reset undocked before hiding state of all plugins before applying layout #22502

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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