How do I disable auto swoosh (automatic space switching) in MacOS Sierra? I don't ever want to be switched between spaces except when I request it explicitly.

In Yosemite, this could be solved by:


disabling "Group windows by application" in Preferences -> Mission Control
typing defaults write com.apple.Dock workspaces-auto-swoosh -bool NO in the terminal.


Together, these prevented all involuntary Space changes.

However, these measures don't seem to work in Sierra.

Clicking in the Dock takes me to another Space if there are any windows for the application on another Space. I don't want this to happen.

How can I change it so that clicking in the Dock cannot move me to a different Space?

note: I've checked ~/Library/Preferences/com.apple.dock.plist -- the value of workspaces-auto-swoosh is NO.
I have macOS Sierra 10.12.6, and this option is in Mission Control settings (also looks like it's in the same place on my old Mac running 10.7.5). Simply uncheck the option "When switching to an application, switch to a Space with open windows for the application", and Cmd-Tab will no longer make you switch Spaces.

Clicking on an app icon in the Dock will also no longer switch spaces, unless the app is already selected (its name is in the menubar), in which case further clicks on the icon will cycle you through any Spaces with a window open for that app. Not 100% what you are asking for, but if the app is already selected you should have no reason to click the icon again anyway.