DiF
DiF

Reputation: 793

Focus Follows Mouse on MacOS

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

Upvotes: 35

Views: 35721

Answers (4)

DiF
DiF

Reputation: 793

This is the answer: https://github.com/sbmpost/AutoRaise Works perfectly.

For the precise, classic behaviour of "focus follows mouse", without raising the window, it must be compiled with the suggested flags

make CXXFLAGS="-DOLD_ACTIVATION_METHOD -DEXPERIMENTAL_FOCUS_FIRST" && make install

and then run with the options:

/Applications/AutoRaise.app/Contents/MacOS/AutoRaise delay=0 focusDelay=1

Upvotes: 35

TYPKRFT
TYPKRFT

Reputation: 316

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.

Upvotes: 4

Luis Soltero
Luis Soltero

Reputation: 21

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.

Upvotes: 1

Trev
Trev

Reputation: 658

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

defaults write com.apple.terminal FocusFollowsMouse -string true

Upvotes: -2

Related Questions