tags:

views:

5047

answers:

9

(I don't want to hear about how crazy I am to want that! :)

Focus-follows-mouse is also known as point-to-focus, pointer focus, and (in some implementations) sloppy focus. [Add other terms that will make this more searchable!]

+18  A: 

Steve Yegge wrote an essay about this a while back, where he tried and failed to write a suitable extension. I've since tried to find focus-follows-mouse applications for OS X and failed also.

John Millikin
He doesn't seem to have put up the code that he wrote either :(
Stuart Axon
+5  A: 

You can do it for Terminal.app by issuing the following command at the command line:

defaults write com.apple.Terminal FocusFollowsMouse -string YES

For X11 apps you can do this:

defaults write com.apple.x11 wm_ffm true

Apparently there's a program called CodeTek Virtual Desktop that'll emulate it systemwide, but it costs $$ (and they never got a version out for OSX Leopard).

Clint Ecker
+3  A: 

Codetek had a product that did this but they never released a version for Leopard or later.

MondoMouse can sort of do focus-follows-mouse, but not auto-raise. Even the focus-follows-mouse is broken though. For example, it doesn't play well with command-tab (if you command-tab to a new application and don't touch the mouse then it should not switch focus back to wherever the mouse pointer happens to be -- I'm pretty sure every implementation in Linux I've seen gets this right but MondoMouse doesn't).

You can enable focus-follows-mouse (no autoraise) for just Terminal windows (just execute the following in a terminal):

defaults write com.apple.Terminal FocusFollowsMouse -string YES

And similarly for X11 windows:

defaults write org.x.X11 wm_ffm -bool true 

(For mac versions previous to 10.5.5 this was:

defaults write com.apple.x11 wm_ffm true

)

I don't know of any other applications that support it.

dreeves
+1  A: 

I currently use MondoMouse and even with its quirks I couldn't use my mac without it. They have a free trial and I would recommend it to everyone.

MondoMouse

mcotton
I've tried MondoMouse, but if I enable focus-follows-mouse, it auto-raises the window. Auto-raise is annoying for me, it decreases my productivity a lot. Is it possible to get focus-follows-mouse without auto-raise?
pts
A: 

You can't really do it well, because the Mac interface simply isn't designed with focus-follows-mouse (with or without auto-raise) in mind. I doubt that's going to change any time soon, and unless it does, everybody who tries to implement focus-follows-mouse will run into the same hurdles and wind up with an unsatisfactory result (to those who want such a thing).

So, yes, you are crazy for wanting this — but for technical reasons. Get used to using the Mac on its own terms and I'm sure your desire to force it to behave just like whatever X11 stuff you used to use will subside in a bit as you find new efficient ways of working.

Chris Hanson
I don't buy this. It works perfectly fine for Terminal and for X11. Why can't that be extended to all applications?
dreeves
Ugh! This simply is not true (at least the "your desire will subside" part). I've been using OSX for about two years now, and while many of the differences are just fine, I'm *still* accidentally closing the wrong tabs because I can *scroll* whatever's under my mouse, but keystrokes go to whatever has focus. It drives me up the wall! I can not overstate how much I dislike this behavior.
John Hyland
Great point about OSX already having scroll-follows-mouse. Do anti focus-follows-mouse people hate that feature? Can it be turned off? (Not that I want to. I consider it better than nothing, but the inconsistency is worse than annoying.)
dreeves
+1  A: 

Interesting that Leopard has one flavor of focus-follows-mouse (sans autoraise) enabled by default. The scroll wheel works in unfocused windows.

cksubs
AFAIK, it's been this way since scroll wheels gained Mac support. It is completely consistent in one sense: buttons/wheels/balls on the mouse follow the pointer, stuff on the keyboard follows focus.
Frank Schmitt
It was a new feature in Leopard. Daring Fireball has a whole load of content on how some widgets/windows are click-to-focus and others are out-of-focus-click-activates-the-widget. So it's definitely not consistent, yet.
cksubs
@Frank Schmitt - Buttons also follow focus - If I want to press a button in Lastfm, then I need to click the window once (even if I'm clicking right on the button) and then the button.
Stuart Axon
+3  A: 

Quoting Chris Hanson "Get used to using the Mac on its own terms and I'm sure your desire to force it to behave just like whatever X11 stuff you used to use will subside in a bit as you find new efficient ways of working."

I strongly disagree with this statement. In this day and age, I shouldn't have to get used to being without a useful/desirable feature because Mac doesn't want me to have it or doesn't think it is useful. The lack of the feature (which is present as an option in all other Unix/Linux distrobutions) is one of the reasons I hate my MAC more every day.

Eric P.
A: 

It's singularly the worst thing about Macs- the lack of this behaviour.

+1  A: 

Focus-follows-mouse is not a particularly suitable input method for OS X because its menu bar was designed to be at the top of the screen. When you move the mouse out of your application window to get to the menus, if it crosses any other application's windows on the way, the menu changes.

So yes, in reply to dreeves comment, it works perfectly fine for Terminal (or for any other single application on the desktop), because the only other windows it's going to affect are Terminal windows, so the menu never changes as you switch windows. And it works fine for X11 because X11 apps generally have their menu bars embedded in the window, so you don't have to leave the window to access them.

Of course you can work around the menu-changing issue by introducing an artificial delay before the focus changes and/or the menu switches, but it's never going to work as well as it does on other desktops.

Calum Benson
Totally fair point about the menu bar though with the standard delay it was not an issue for me in practice.
dreeves