If I have an application with two windows in different workspaces, with the application in the foreground in one workspace and in the background in another, switching to the workspace with the application in the background brings that application to the foreground.
- Open two Chrome windows
- Drag one of the Chrome windows to a different workspace
- Launch another application, putting the Chrome window into the background
- Switch to the other workspace
- Switch back
What happens when I switch back to the first workspace is that the other application remains in the foreground for a split second before Chrome jumps to the foreground. I've noticed this behavior with multiple applications, most notably Chrome and iTerm2.
It seems like macOS is attempting to preserve application focus across workspace, i.e. ensuring that if the user had application X in the foreground on workspace A, then application X remains in the foreground even when they switch to workspace B. Is there a way to tell macOS to switch application focus along with workspaces? If I have an application in the background in one workspace, that's for a reason, and I don't want macOS to "helpfully" bring an application to the foreground just because I was using that application on a different workspace.