Focus Follows Mouse on MacOS

Viewed 8517

PROBLEM: how to implement focus follow mouse for all windows / apps on MacOS?

CONTEXT: terminal commands such as "defaults write com.apple.terminal FocusFollowsMouse -string true" implement the desired behavior ONLY for terminal windows.

SIMILAR POST: Implement "Mouse Follows Focus" on MacOS

4 Answers

Note for users with Case Sensitive file systems (like many of us) the command should be defaults write com.apple.Terminal FocusFollowsMouse -string YES note the "T" in terminal. Otherwise terminal will ignore the setting. Also in Monterey I used Xcode to edit the plist and found that FocusFollowsMouse was already present but as a boolean and not a string. The entry must have type string with value YES to work properly.

Once the above changes were made terminal worked with FocusFollowsMouse on my new M1 MacBook Pro with Monterey.

Yabai Window Manager also has an autofocus implementation, along with window borders and other features. It may be overkill for this specific use case, but for people looking for this feature because they came from another TWM it may be helpful.

This is what I use successfully on Mojave and Big Sur on an M1 Mac:

defaults write com.apple.terminal FocusFollowsMouse -string true

Related