[Interest] focus-follows-mouse

René J. V. Bertin rjvbertin at gmail.com
Thu Sep 24 13:08:12 CEST 2015


Thiago Macieira wrote:


>> probably doesn't work only because setFocus() requires that the window be
>> active (= to the front). Adding an activateWindow() before the setFocus()
>> call  gives FFM, but with window raising.
> 
> Then you run into focus-stealing-prevention in window managers.

You might, but AFAIK not on OS X where I'd be interested in implementing the 
feature (because it's not an option in the window manager).

> Anyway, focus between windows is entirely in the province of the window
> manager. You can ask, but the WM is not required to do what you ask.

Sure. This works on OS X though (and I think the WM is supposed to comply):

- (void)mouseEntered:(NSEvent *)event
{
    [[self window] makeKeyWindow];
}

Maybe I could extend QCocoaView (or the corresponding ObjC class) to do 
something like this in the application I'm trying to modify, but frankly, I 
think I'd prefer to avoid that, no matter how much I like the fact one *can* 
pull off that kind of stunt with ObjC :)

In fact, Apple's own terminal emulator even has a FFM feature that works if the 
app isn't the active application.

R.




More information about the Interest mailing list