Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
After hitting F1, I try to toggle back from the viewer to the editor using ALT-TAB, but I end up having to cycle through all open windows before getting back to the editor. Is there no way of toggling back directly with just one ALT-TAB?
Alt+Tab is the OS shortcut for cycling all open windows.
For the embedded viewer you can use Ctrl+Alt+Left/Right (View -> Focus Editor/Viewer to switch between Editor and viewer. From the windowed viewer there is currently only Go to Source (Ctrl+') which also moves the cursor in the editor to the position currently displayed in the viewer.
View -> Focus Editor/Viewer
Go to Source
Thank you for the response. I really think you should consider this in future editions. I think people who are used to alt-tab find it very distracting that they don't go back to the editor directly. This is more pertinent in this case because of the frequent back and forth needed between the editor and viewer. I know I could use the embedded viewer but some, like me, find it too small.
Thanks for all the good work.
I agree with NKW.
I'm not sure I understand your suggestion. Alt+Tab is an OS shortcut on many operating systems (including Windows and Ubuntu). It's not even propagated to the application. So the Alt+Tab behavior is totally defined by your OS, we cannot do anything about this. Moreover, the OS usually uses a stack of recently used windows, so if you open the viewer from TXS and hit Alt+Tab the OS should bring you back to the most recently used window, which is the TXS editor in this case (tested on Windows and Ubuntu).
"...so if you open the viewer from TXS and hit Alt+Tab the OS should bring you back to the most recently used window, which is the TXS editor in this case (tested on Windows and Ubuntu)."
I use WinXP and when I hit Alt-Tab, it does not go back to the editor directly even when the editor was the most recently used window (specifically, after building with F1). That's the issue I've been trying to describe. But you say you tested it on Windows. Could it be an issue of the version of Windows?
Tested also on XP: works for me. The way it should work is described here:
Maybe you have some 'always on top' windows from other applications? Does it work as described in the link for other windows?
I think I figured it out! (and it's weird)
I was trying to replicate the incident with a test file and record it off my PC, but Alt-Tab was now working correctly. After some tinkering, I realised that the Alt-Tab issue happens only when there are spaces in the file name. I don't know if this is interesting information to you guys. In any case, lesson learned on my part.
Here it works also with spaces in the file name. (And I would be really surprised if that influenced window tabbing)
I am absolutely sure that that is the problem. I'm trying it right now with two identical files in the same folder, one with a space in the file name and one without. It does not happen at all with the file without spaces in the file name while it does with the other one. To be very specific, here's what happens with the file with spaces: I open the file afresh (with TexStudio closed), I hit F1, then Alt-Tab, and it goes back to the editor, but only that first time. I hit F1 again, then Alt-Tab, and not it doesn't go back to the editor. The issue persists on all subsequent build-and-views.
Strange indeed. Following your description, I can reproduce it now but only on XP not on Win7. It appears that the window is brought up, but focus stays on the editor. Anyway, it's currently not recommended to use tex filenames containing spaces since synctex has some problems with that (Does syncing between editor and viewer work for you (Editor: Context menu: Go to PDF, Viewer: Ctrl+LeftClick)?
Moreover, I've added Window -> Focus Editor (Ctrl+Alt+Left) to the Viewer. So from the next relase on, swichting focus works consistenly with Ctrl+Alt+Left/Right no matter if you use the embedded or windowed viewer.
Yep, Ctrl+LeftClick does work.
I'd much rather keep using Alt-Tab and I'm more than happy to keep my filenames spaceless. Thanks for your help.