xolox / vim-shell

Improved integration between Vim and its environment (fullscreen, open URL, background command execution)
http://peterodding.com/code/vim/shell/
169 stars 13 forks source link

Open & Fullscreen focus #9

Closed mMontu closed 11 years ago

mMontu commented 12 years ago

When Vim is not in fullscreen and :Open is executed the external application (file browser, web browser) opens in front of Vim and get the focus - which I believe is the expected behavior, as you'd normally use the application that was just started.

But if :Fullscreen is executed before :Open then the external application opens but Vim retains the focus. Is there an option to make the external application to get the focus?

xolox commented 11 years ago

In the latest version WS_EX_TOPMOST can now be disabled using the g:shell_fullscreen_always_on_top option but Alt-Tab does not work for me. Please try it out and let me know whether this works for you.

mMontu commented 11 years ago

I've tried let g:shell_fullscreen_always_on_top = 0 and noticed some changes in the behavior, but issuing Open while in Fullscreen still displays gVim, while the focus seems to change to the hidden file browser.

Alt-Tab doesn't work for me neither.

I've tested this on windows xp.

xolox commented 11 years ago

A peek inside the "Vim plug-in design" process in my brain:

While working on this answer and considering my options I decided to take another quick stab at fixing the Windows API code and it worked! I can now full screen my Vim on Windows XP while being able to Alt-Tab to other programs. :Open also focuses the newly started program when g:shell_fullscreen_always_on_top is set to 0 (false).

I'm closing this issue now as the problem should be resolved. If it's not, feel free to reopen the issue. Thanks for the bug report and making vim-shell better :-).

mMontu commented 11 years ago

Both Alt-Tab and focus are working very well for me! I've tested it on Windows XP and 7.

There is only one minor problem: when gVim window is maximized and one calls :Fullscreen twice, the resulting window is not maximized anymore.