11

After upgrading to a second monitor I have run into some unexpected cmd+tab behavior that is really impacting my workflow:

With one monitor, when using cmd+tab to switch between applications, OS X gives the focus to the last active window of the application one switches to. With multiple monitors, OS X prefers windows that are on the same monitor as the previous application.

To give an example:

  • Consider having Xcode on monitor 1 and Terminal (window A) on monitor 2 and (window B) on monitor 2; focus is on Terminal window B
  • you cmd+tab to Xcode
  • you cmd+tab back to Terminal, but now window A has the focus and not window B

This behavior is potentially hazardous as one starts to enter commands into Terminal before realizing that the focus is on the wrong window.

My question is: Is there a way to make cmd+tab always return to the last active window of an application no matter on which screen the focus at the moment?

  • system prefs > Mission Control... do you have 'Displays have separate Spaces' checked? That would be my prime suspect. I switched that one off the day it appeared in the OS. – Tetsujin Aug 26 '15 at 7:31
  • 1
    Thank you, that solved the problem already partially. Now, there is the new question of how do I get to retain the menubar on the second screen (and possibly the dock, but that is not so important)? – shiin Aug 26 '15 at 14:53
  • ahh - as far as I know, that's not possible. Menu & Dock stays where it is, on the primary screen. For me, that's not an issue, in fact my muscle memory prefers it that way & I'm a key-command kind of user anyway. Maybe there's some 3rd party solution? I'd be tempted to raise it as a new question. – Tetsujin Aug 26 '15 at 14:56
  • Ok, I'll add it as a new question. Can I somehow accept your above answer as you only commented and did not answer the question in the stack exchange sense. – shiin Aug 26 '15 at 16:39
  • 3
    Having separate spaces for my monitors was a great help for my workflow, not in the least because I could have a fullscreen program on one monitor and still use my other monitor for other things (with the Displays have separate Spaces option unchecked, going into fullscreen on one monitor makes the other one go black). I'd appreciate any fix that allowed me to keep my separate spaces... – A.Wan Dec 7 '15 at 22:27
5

System prefs > Mission Control... uncheck 'Displays have separate Spaces'
That would be my prime suspect. I switched that one off the day it appeared in the OS.

From comments, that will disable the ability to move the menu bar & dock to each screen on an ad-hoc basis, though - which may be best asked as a separate question requesting a possible 3rd party solution, as I know of no way to do that natively.

6

Contexts offers significant customization for macOS window-switcher (Alt-Tab shortcut) behavior, location across multiple displays, and appearance.

Install Contexts.app. Run it. Then select Panel->'Show Panel on', as per the following screenshot, which shows the switcher on 'All displays' in the setting below. You have option to also set to the Active or Primary displays, the latter being the display with the menu bar, which is configurable.

This may or may not solve your exact problem, or possibly provide even a better alternative. I myself like displaying the switcher on all displays.

All displays

  • At the moment this looks more like a generic product recommendation than a specific answer. Can you amend your answer to show how the application can be used to solve the problem described in the question? – nohillside Jul 27 '18 at 13:27
  • It's a bona fide solution, and the only one that I've found that solves the problem of displaying the switcher on any and all monitors. I'll update the answer as you request. However, I'm now significantly de-motivated with StackExchange religion (this is obviously not the first time I've seen this kind of feedback) about anti-product recommendations. (I have no affiliation with Contexts.) Is apple.stackexchange.com a company recommendation for Apple? So... I've had it with StackExchange. You're now losing many of my future contributions. – Johnny Utahh Jul 28 '18 at 2:02
  • If I still have a -1 vote on my answer, I will plan to delete it sometime later. – Johnny Utahh Jul 28 '18 at 2:12
  • Thanks for the edit. Sorry you feel that way, please keep in mind that most of the SE sites are about providing practical solutions. So describing how a specific product can be used to accomplish something is always better than just dropping the name of a product (which sometimes is hard to differentiate from spam). – nohillside Jul 28 '18 at 5:08
  • 1
    Yep, I think I understand your point. And yours has been the nicest flavor of this StackExchange policy (what I call "anti-product-recommendation religion" above) execution I've yet seen - so kudos to you, @nohillside. However, the policy has been, in my experience, generally enforced differently than I care for it to be; in other arenas I've received what has felt like attacks for simply trying to provide helpful information. Yours is the straw that breaks the camels back. My way to protest is to say that StackExchange will possibly get less of my contributive time. – Johnny Utahh Jul 29 '18 at 21:31
1

In Sierra(not sure about older OSX versions) it is possible to temporary lock the cmd+tab menu in specific display. Dock > Finder icon > Right Click > Options > Desktop on Display[n] where [n] is number of desired display.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .