switching between windows in different spaces with the keyboard

46 views
Skip to first unread message

David Sanson

unread,
Jan 19, 2012, 11:07:24 AM1/19/12
to vim...@googlegroups.com
I suspect this is impossible, given that it seems to be an issue with Lion's implementation of spaces rather than anything specific to MacVim. But it sure would be nice to able to use the keyboard to cycle to MacVim windows in other spaces, including those in their own native full-screen space. Has anyone figured out a way of doing this?

With the mouse, a simple click on the dock icon cycles through all the windows in the all the spaces. But I don't know of any way to emulate this with the keyboard, and the Dock doesn't show up in full-screen mode. A bit more cumbersome, but keyboard only, is to use the shortcut for the "Application Windows" view in Mission Control (by default, assigned to F10, I think). From there, one can arrow around between open windows and recently opened documents. But this doesn't work in full-screen mode either.

Funny, but I think this is going to be the issue that leads me to disable the native full-screen support in MacVim.

-David

björn

unread,
Jan 19, 2012, 12:37:33 PM1/19/12
to vim...@googlegroups.com
On 19 January 2012 17:07, David Sanson wrote:
> I suspect this is impossible, given that it seems to be an issue with Lion's
> implementation of spaces rather than anything specific to MacVim. But it
> sure would be nice to able to use the keyboard to cycle to MacVim windows in
> other spaces, including those in their own native full-screen space. Has
> anyone figured out a way of doing this?
>
> With the mouse, a simple click on the dock icon cycles through all the
> windows in the all the spaces. But I don't know of any way to emulate this
> with the keyboard, and the Dock doesn't show up in full-screen mode. A bit
> more cumbersome, but keyboard only, is to use the shortcut for the
> "Application Windows" view in Mission Control (by default, assigned to F10,
> I think). From there, one can arrow around between open windows and recently
> opened documents. But this doesn't work in full-screen mode either.

I had a look at this and it turns out that it sort of already works to
cycle through windows in native full-screen. The catch is that it
only works if you cycle to another window once before entering
full-screen.

It almost seems like a bug in Lion: if I enter and immediately exit
full-screen, then it is no longer possible to cycle to another window
(even though I'm out of full-screen). If I click on another (MacVim-)
window when the current window is in this state, then I can cycle back
and everything works (even in full-screen).

I've tried to work around this bug by setting
NSWindowCollectionBehaviorParticipatesInCycle at various places in the
code, but no luck so far. Not really sure what to do about it, but it
seems that some hack is in order to get this working.

I'll let this rest and ask that somebody else takes a look at it.

Björn

Xiao G. Wu

unread,
Jan 19, 2012, 12:41:44 PM1/19/12
to vim...@googlegroups.com

It would be really nice if we could implement it like how the Mac terminal App works. Command-`

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

David Sanson

unread,
Jan 19, 2012, 2:25:31 PM1/19/12
to vim...@googlegroups.com
On Thursday, January 19, 2012 12:37:33 PM UTC-5, björn wrote:

I had a look at this and it turns out that it sort of already works to
cycle through windows in native full-screen.  The catch is that it
only works if you cycle to another window once before entering
full-screen.

Can you explain a bit more? Are you saying that you can cycle between MacVim windows in different spaces in the usual way, i.e., CMD-`? I can't get even this to work in MacVim (or any other program I've tried, including Terminal.app), and that seems to be independent of whether or not any of the windows are fullscreen. So I was inferring that the problem was that (a) cycling between windows in different spaces doesn't work in Lion (except via the icon clicking trick); (b) a native fullscreen window is in its own space; (c) the dock isn't available in fullscreen, so the clicking trick isn't available either. But it sounds like you are saying that (a) is wrong, or only true for you in certain circumstances?
 

It almost seems like a bug in Lion: if I enter and immediately exit
full-screen, then it is no longer possible to cycle to another window
(even though I'm out of full-screen).  

Okay. Yes, I've noticed this too, and it does seem like a bug. But I wasn't able to replicate it in Terminal.app or Chrome.app, so I'm not sure it is a Lion bug.
 

If I click on another (MacVim-)
window when the current window is in this state, then I can cycle back
and everything works (even in full-screen).

I can replicate everything about this except the "even in full-screen" bit. What once again works for me, after I click on another MacVim window is cycling between windows within the current space.
 

I've tried to work around this bug by setting
NSWindowCollectionBehaviorParticipatesInCycle at various places in the
code, but no luck so far.  Not really sure what to do about it, but it
seems that some hack is in order to get this working.

I'll let this rest and ask that somebody else takes a look at it.

Sounds reasonable. At this point, I am wondering if I have some system wide setting that is blocking cycling through windows in different spaces in all my applications, and is unrelated to the apparent bug you describe above.

I should mention I am running MacVim built using homebrew, from commit 9fbcbadb0, dating back to January 10th.

David

David Sanson

unread,
Jan 19, 2012, 2:30:07 PM1/19/12
to vim...@googlegroups.com
On Thursday, January 19, 2012 12:41:44 PM UTC-5, Xiao G. Wu wrote:

It would be really nice if we could implement it like how the Mac terminal App works. Command-`

That should already work. If not, add something like

   map <D-`> :maca _cycleWindows:<CR>
   map <D-~> :maca _cycleWindowsBackwards:<CR>

to your .gvimrc, and you should be good to go. For more information, search the list for `_cycleWindows`. You'll find that some issues arise depending on your keyboard layout.

David
 
Reply all
Reply to author
Forward
0 new messages