36

"Focus follows mouse" or "sloppy focus" is a feature common to X11 window managers on Linux/Unix, including GNOME, KDE, CDE, XFCE and window managers like Enlightenment, Fluxbox and Window Maker. It is also available via TweakUI on Windows. Some individual applications on OS X, like iTerm support it.

What is it? Simply put, the window where the mouse pointer is has focus, rather than having to click a window for it to gain focus.

Does the native GUI for OS X support this, with some hidden setting?

7
  • 1
    Why do you want this? (I know that sounds a bit mean, but I'm curious.) Aug 21, 2009 at 18:30
  • 13
    Its a feature of X11 I've used for many (~15) years on Linux systems, and its nice to just bump the mouse over to another window.
    – jtimberman
    Aug 21, 2009 at 18:52
  • Eewwh! Your business, of course, but first thing I do on setting up a new (to me) WM in X is find the click-to-focus option. Aug 22, 2009 at 1:06
  • 5
    In case someone is wondering the same thing as @BenjaminDobson and, one of the biggest things this allows is to decouple the window focus and the window raise (putting it on top). It may seem strange, but once you are used to it, the ability to type in a window that isn't "on top" is huge. If part of the window with which you are interacting can be covered by a window displaying information to which you are actively referring, it allows dramatically fewer clicks, movements, and keyboard-mouse-keyboard switches for many common tasks.
    – derekv
    Feb 10, 2016 at 15:30
  • related: stackoverflow.com/a/98331/127971 also see answer below about enabling this feature specifically (and only) for terminal superuser.com/a/27545/73961
    – michael
    Jan 5 at 12:49

7 Answers 7

11

The fundamental problem with sloppy focus on the Mac is that the menu bar is always associated with the currently focused application; if you had sloppy focus, accessing the menu bar for a specific application would be supremely difficult.

Having said that, Zooom/2 does what you want, in addition to providing equivalents to the open-source window manager features for ctrl+click moving & resizing of windows.

13
  • 3
    The focus follows mouse is nice, and the keyboard shortcut part is interesting, but I'd like something that didn't autoraise :/.
    – jtimberman
    Aug 21, 2009 at 17:49
  • 3
    Zooom/2 only raises (and focuses) a window after a delay. Aug 23, 2009 at 8:32
  • 12
    As the other comments say, Zooom/2 does not actually implement FFM or sloppy focus. It is limited to autoraising windows, which is a very different thing. Sadly, it seems that for the time being there is no good way to do this in OS X. As @andz responded, Steve Yegge has a good writeup on this, as well as sample code you can use to achieve a limited version of "sloppy focus" (limited in that modifier keys do not work).
    – pix0r
    Dec 2, 2009 at 23:28
  • 8
    Somehow Ubuntu Unity manages to enable focus-follows-mouse or "sloppy focus" with a single menu bar. Shame Apple can't. Mar 29, 2012 at 17:45
  • 2
    Almost every request of of focus-follow-mouse is met with an answer of auto-raise. This one is no exception. And it is really unfortunate that this answer is chosen as the best answer. I would quote Steve Yegge's blog: "I, for one, think of autoraise as a big, stinky, deceased buffalo carcass that someone thoughtfully dragged into my living room while I was on vacation, probably towards the beginning of the vacation, and then they turned up my thermostat to 110°F, closed the windows and tossed a Durian fruit at the wall for good measure."
    – some user
    Oct 6, 2015 at 19:23
20

The standard Terminal application included in Mac OS X will do focus-follows-mouse (within that application only, and no auto-raise) if you run this command from a shell and then restart the Terminal app:

% defaults write com.apple.Terminal FocusFollowsMouse -boolean YES
2
  • 7
    Yes, and I use iTerm.app instead of Terminal.app (other reasons), which does the same. I want FocusFollowsMouse for all applications, not just terminals.
    – jtimberman
    Aug 21, 2009 at 23:32
  • 1
    @jtimberman Thank you! On iTerm2 Build 2.1.4 I activated it by going to Profiles->Open Profiles (pick a proflle and) Edit Profiles... Point Tab, Miscellaneous Settings check Focus Follows Mouse. Since this is restricted to iTerm only it doesn't mess up the other Apple-ey parts of the UI, and I get to type into terminal window that's not on top. Yeah!
    – kmarsh
    Dec 22, 2015 at 16:04
8

@Drew

The fundamental problem with sloppy focus on the Mac is that the menu bar is always associated with the currently focused application; if you had sloppy focus, accessing the menu bar for a specific application would be supremely difficult.

The menu bar wouldn't have to be changed though, just like you wouldn't have to enable auto-raise.

Having said that, Zooom/2 does what you want ...

But as was mentioned in the comments: not without auto-raise, which just makes it unusable. Another caveat is that it activates Finder whenever you move the mouse over the desktop, so you'll pretty much have to add Finder to the ignore list. Both of these issues apply for MondoMouse too.

It wasn't mentioned here yet, but OS X has click-through — if you hold , it's possible to click most items in background windows.

2
  • Please note that Drew will not get notified of your reply. You should start commenting on others' posts if you want to reply to them.
    – Daniel Beck
    Mar 12, 2011 at 16:19
  • @Daniel I didn't really mean to address this answer as a reply to him, I just thought the block quote would've seemed out of place without the username. But it would indeed be better to clearly separate answers from comments, and quote other answers sparingly. I also did think that other answerers can be notified. The meta thread about @replies doesn't state it very clearly.
    – Lri
    Mar 12, 2011 at 18:13
7

Steve Yegge over at his blog claims that focus follow mouse with no autoraise isn't going to happen on OS X anytime soon:

http://steve-yegge.blogspot.com/2008/04/settling-osx-focus-follows-mouse-debate.html

Since ALL OS X utilities out there that promise "focus follows mouse" do autoraise, I think Steve Yegge is sadly right.

5

It should be noted that Leopard introduced "Scrolling Focus Follows Mouse," where you can scroll via the mouse scroll wheel or a trackpad gesture on any window that the mouse is over.

Except, of course, Microsoft Word for Mac.

This is a great feature that, while not full Focus-Follows-Mouse, proves that some aspects of it can be done in OS X.

3

There should be no problem with doing focus-follows-mouse without autoraise across all applications, as the Terminal example and command-click prove, but you'd need to inject code into running applications via mach_inject or similar. You'd essentially write an "input manager" that redirects the keystrokes/clicks any time the mouse enters a textbox/button. Any click that doesn't hit a button raises the window. And command-click only raises the window.

0

The free, open-source Amethyst Mac app is an alternative to Zooom and Mondomouse (Whose links above seem to be broken).

You can download Amethyst here: https://github.com/ianyh/Amethyst

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .