-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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: Prevent Editor dockwidget to become visible when clicking on the outline explorer if the Editor is in a separate window #5742
Conversation
Moreover, in this PR, we are also forcing the docked outline explorer to connect to the editor in the separate window instead of connecting to the invisible docked editor. This is done by overriding the value of the |
Also, fixing this issue for the 3.x branch is a little bit more complicated because in this branch one or more editors in separate windows are allowed to live at the same time alongside a docked editor. I'll try to see what I can do and I will submit another PR for the 3.x branch if I find an acceptable solution. |
I will continue to work on this one to see if I could find a way to fix this for Spyder 3 and 4 with a single PR. Below I try to summarize a little bit more the situation and the main difference between Spyder 3 and 4 and what is the behaviour I think should be expected when clicking on the outline explorer. Spyder 3In Spyder 3, undocking the editor will simply undock the dockwidget in which the editor lives. It is however possible to open an unlimited amount of new editorstack instances in separate window through the action "New Window" in the cog menu. Opening an editorstack in a new window will not hide the dockwidget. Therefore in Spyder 3, a docked editor can live alongside one or more editors in separate windows. This is why Issue #2883 is harder (but not impossible) to fix for Spyder 3 than 4. Spyder 4PR #3824 changed this behaviour in Spyder4. Undocking the editor while So following this line of thoughts, here is what I think should happen in Spyder 4 when clicking on the outline explorer:
|
My thoughts:
|
Thank you @ccordoba12 for your inputs! I've made some minor changes and tested it for Spyder 3. The PR solve the undesired behaviour reported in Issue #2883 for Spyder 3. The only thing that doesn't work perfectly in Spyder3 is when multiple editorwindows were created and a Everything else seems to be working as expected though. |
Great! Thanks a lot for taking a look at this! Please move this PR to @dalthviz, please review Jean's work. |
be7e455
to
0a52d8d
Compare
Pinging @dalthviz again about this one ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks Jean!
Fixes #2883
Before PR #3824, Issue #2883 was hard to reproduce. But now that separate windows are created by default when undocking widgets, this issue has become easily reproducible and is much more annoying. One simply has to undock the editor and click on the outline explorer to trigger it (see animation below).
This is due to the fact that a
setVisible(True)
,setFocus()
andraise_()
is systematically called on the editor dockwidget in the load method, which is the method that is connected to the action of clicking on the outline explorer. To fix Issue #2883, we simply have to prevent these calls when the editor is in a separate window and callsetFocus
andraise_()
on this separate window instead.