Open adam-urbanczyk opened 1 year ago
Hi @adam-urbanczyk thank you for the feedback! I think I was able to reproduce this! Checking with the Terminal plugin, although the plugin pane gets raised, the actual focus is still either in the Editor pane or in the IPython Console pane.
We will try to check this in a future release :+1:
I think this is not something we can do here. Instead, it should be a matter of setting the RAISE_AND_FOCUS
plugin constant to True
in those plugins:
@jitseniesen, could you try that on Spyder-notebook to see if it works with that plugin?
If this is the solution, maybe you could change the default to True
?
I think this is not something we can do here. Instead, it should be a matter of setting the RAISE_AND_FOCUS plugin constant to True in those plugins
Just in case, checked changing the default value of the constant to True
in the Spyder code and seems like that indeed fixes this. In the case of the Terminal pluing the prompt gets focused. Is there any reason why the default value of the constant is False
@ccordoba12 ?
could you try that on Spyder-notebook to see if it works with that plugin?
Good call! Yes, it works. I created PR spyder-ide/spyder-notebook#440 with that fix.
Is there any reason why the default value of the constant is
False
My understanding is that this is for informational panes like the Variable Explorer and Code Analysis. When a user is typing code in the editor or console, they may want to raise those informational panes to have a look at them, but they typically want to continue in the editor or console so they don't want to give focus to the informational panes.
Is there any reason why the default value of the constant is False @ccordoba12 ?
It's exactly as @jitseniesen described: there are some plugins (actually, most of them) to which you don't want to give focus, just raise them to visibility to see what they are displaying.
Makes sense, thanks for the explanations! Will create then an issue for the Terminal plugin referencing this one. Probably after that we could close this one right?
AFAICT this part is not true, so maybe still a bug of spyder?
# If False, the widget will be raised but focus will not be given until
# the action to switch is called a second time.
Yeah, that's a good point but I'm not sure if we should implement it.
@jitseniesen, @dalthviz, what do you think?
Not totally sure either 🤔 That behavior was working at some point then? If that is the case then makes sense to me to implemented/reimplemented, otherwise no
I think the RAISE_AND_FOCUS behaviour originates from PR #11684 and I assume it worked at that time. But it does not work in current Spyder 5 and as far as I know nobody complained about it, so I'd say it is not a priority.
On the other hand, I think it is important for accessibility, to make sure that all functionality can be accessed without the mouse. However this is probably best done as part of a complete accessibility assessment.
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
Problem Description
Switching to terminal or notebook using keyboard shortcuts does not restore focus - one cannot immediately start typing when switching to those panes from e.g. editor or console.
What steps reproduce the problem?
What is the expected output? What do you see instead?
Focus is restored when switching back.
Paste Traceback/Error Below (if applicable)
NA
Versions
Dependencies