13

I have a MacBook Pro running Catalina with an additional display. I typically have my development-related apps on one display (iTerm2, VSCode, etc.) and everything else on the other display (Chrome, Slack, etc.)

Sometimes (not all the time), when I switch desktops (Ctrl+left or Ctrl+right), access an app using Spotlight (Cmd+space and type), or use Cmd+Tab to switch applications, the focus would suddenly jump to iTerm2 or VSCode. This happens even if iTerm2 or VSCode isn't currently showing; for example, if I try to switch to Chrome on display 1 and iTerm2 is on a different hidden desktop on display 2, Chrome would appear on display 1 and then display 2 would show the desktop containing iTerm2 sliding into view (along with focusing iTerm2).

This severely impacts workflow, since this behavior is unpredictable and involves a lot of typing in the wrong application and reaching for the mouse. What is causing this behavior?

sunw
  • 535
  • 5
  • 29
  • Do you have any of these apps open in fullscreen? I find that using Cmd+Tab to switch focus works poorly if one of the apps in between is open in fullscreen (it doesn't necessarily bring the fullscreen app into focus). – otolock Apr 01 '20 at 21:19
  • Yes I specifically have iTerm2 and VSCode in full screen, but my problem is different--I don't want a full-screen app to enter focus, but it does against my will. Let's say that I have Slack not in focus on my left screen (some other app on my left screen is in focus), and Chrome on my right screen (with iTerm2 in full-screen mode on another desktop). When I try to switch my focus to Slack either through Ctrl+left/right or Spotlight, macOS inexplicably makes iTerm2 on the *other* screen focused. – sunw Apr 02 '20 at 15:10
  • I think I have the same issue. It not only happens using `Ctrl+left` or `Ctrl+right` but also with mouse gestures on my Logitech MX Master 3. In my case I have Microsoft Outlook full-screen on the other display, and it gets focus instead of iTerm2 or Firefox or VSCode or whatever is shifted into view. Outlook seems to grab focus even if it is the last app on the `Cmd-tab` list, and even if there are other apps currently displaying full screen on the other display. – Brandon Bonds Oct 23 '20 at 17:10
  • 1
    I have same problem with chrome and vscode on separate desktops. – AntonKrutikov Oct 23 '20 at 20:43
  • 5
    Exit fullscreen view of the app causing the problem (iTerm 2 in your case) and then make it fullscreen again. This solves the exact problem I have. – Ridvan Sumset Nov 05 '20 at 13:00
  • having the same problem for me.... I am using MacOS Catalaina 10.15.3 – Lokesh Sanapalli Dec 10 '20 at 07:03

3 Answers3

5

I found that it only happens when I have windows of the same app on both screens.

Say I switch desktop on a screen 1 and Chrome should become active there, then if I also have a Chrome window on my screen 2, it's actually the one on screen 2 that becomes active. Very frustrating..

Sonastra
  • 182
  • 1
  • 9
  • 3
    This. Still happens in Monterey as of Feb. 2022, though. Very frustrating indeed. – pjpires Feb 07 '22 at 22:53
  • 1
    I just closed a Finder window in another workspace and that solved the issue for me. Thanks for giving me the idea. – ofekp Nov 22 '22 at 15:48
2

This bug still exists in macOS Big Sur 11.4. Another symptom is that, after the erroneous focusing happens, manually switching to a space with no windows in it will leave that focused app focused, after briefly focusing Finder, rather than just focusing Finder. It's this last erroneous focusing that causes the space-switching.

Workaround: when it happens, invoke "Show All" from the menu bar (I have a keyboard shortcut for this). Note that switching to an empty space now does a single focusing of Finder, and no further space-switching happens.

ccrraaiigg
  • 21
  • 3
-1

I'm ready to throw out my MacBook and go back to the PC. It's extremely unproductive compared to the PC for this sole reason. Half my day is spent trying to get back to what I was working on because the system changes context across all screens, replacing what should be in focus with something related to what was triggered on a separate screen. The screens don't behave mutually exclusively. This laptop is for the single screen user...the coffee shop kids. While using multi-screens, I consider it about as unintuitive as it gets. Running Ventura 13.2.1.

  • 1
    This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/33949606) – S.B Mar 05 '23 at 17:17