Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I can understand the problem, but isn't there a sort of "gordian knot" solution for this? In other words, can't you "domesticate" autoraise into a kinder, gentler autofocus?

When you keydown and your mouse isn't within the current window:

1. Store the z-positions of all windows (if you haven't already)

2. raise the window you're hovering over to the front and focus it

3. re-send the event

4. set a timer to reset the z-positions of all windows, refocusing the old window

5. if you happen to click anywhere, simply kill the timer and throw away the z-stack.

Hopefully, any animations associated with window refocusing could temporarily be turned off for both z-shuffling events, and in the interstice there could be some smooth "fade-decay" effect that shows that the window is indeed receiving input behind it, but only temporarily. Feels Apple-y already.



One of the commenters points this out, but bringing the under-the-mouse application into focus isn't strictly speaking a problem, assuming it doesn't fuck up the window stacking (although it might be a little slow).

An approach that might work would be to bring the application under the mouse to the logical "front" (i.e. it's menu bar shows up), but suppress the re-ordering of windows that normally occurs.

This would probably be an OS-level thing that Apple would have to do, however, rather than something SteveY could hack together in two days.

FFM does work within any one application, since Terminal supports it:

  defaults write com.apple.Terminal FocusFollowsMouse -string YES
(you have to re-launch Terminal). Then all Terminal windows do FFM, and the focused window has the standard focused appearance, except without popping to the top of the window stack like it normally would.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: