Florian Posted November 17, 2014 Posted November 17, 2014 Hey Andrew and Vero and everyone else, There is this thing I don't really know anything about: foreground priority taking. I mean Alfred is always in front of regular apps, but also always behind anything that tries to "always float on top". So I don't know how that works exactly but what I do know it's that alfred is very quick to pop in and out, and performs punctual actions, and I believe it should take priority over a "always on top" itunes mini player, a "stay on top" mpv or "float on top" vlc. Could there be a way for alfred to take priority over itunes, vlc, mpv... and always be the frontmost app when popping in? Cheers, Florian.
Tyler Eich Posted November 20, 2014 Posted November 20, 2014 As far as I know, there are ways to do this. An instance of NSWindow can be placed in a layer higher than NSNormalWindowLevel (the default), like NSFloatingWindowLevel. The only hurdle is deciding which level to put the window on. There are higher levels than NSFloatingWindow, so other apps who have used these levels will be above Alfred. https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/WinPanel/Concepts/WindowLevel.html#//apple_ref/doc/uid/20000227-BAJDJEDA
Andrew Posted March 11, 2015 Posted March 11, 2015 I'm going to bring Alfred just in front of modal dialogs for the next release, you'll have to let me know if this is far enough forward for the apps you mention
wolph Posted April 8, 2015 Posted April 8, 2015 (edited) One application to test with: mpv Just run: mpv --ontop [some_video_file(s).mpg|some_photo_file(s).jpg] Would be a lot more usable if it'd be always in front The relevant code from MPV: https://github.com/mpv-player/mpv/blob/efe0fb75bc4bc3572edd241e60f31d620413a919/video/out/cocoa_common.m#L395 s->window_level = NSMainMenuWindowLevel + 2; Edited April 8, 2015 by wolph
Florian Posted May 23, 2015 Author Posted May 23, 2015 Hey Andrew. I've been slacking here, so I don't know if this was actually implemented... But Alfred still is behind VLC and MPV when these are in 'float on top' mode...
wolph Posted June 29, 2015 Posted June 29, 2015 Ping Still not working with the latest version of Alfred and MPV
Andrew Posted July 6, 2015 Posted July 6, 2015 I'm making a few changes to the focus / key status in the next release, so I'll look at making Alfred NSMainMenuWindowLevel + 3 Edit: Scratch that, unfortunately, that puts the QuickLook window behind Alfred so this change isn't possible.
wolph Posted July 6, 2015 Posted July 6, 2015 That's unfortunate Is there any other way to work around this issue? Not having Alfred on-top is quite inconvenient at times
Andrew Posted July 6, 2015 Posted July 6, 2015 I've been playing with this for a little while and it looks like OS X caps the window level of the preview window so there is no way around this issue. I'm reluctant to put in a hack (defaults write) to force Alfred's window level, but I've left this ticket open in my bug tracker to think about what can be done.
Andrew Posted July 6, 2015 Posted July 6, 2015 Ok ok, no worries... managed it! Alfred can have a more aggressive foreground with QL still in front
wolph Posted July 6, 2015 Posted July 6, 2015 Brilliant, Alfred is all I care about really, I rarely use QL anyhow.
Florian Posted July 6, 2015 Author Posted July 6, 2015 Yay !! Genius ! This is really going to improve my experience here :-) Thanks !
Andrew Posted August 19, 2015 Posted August 19, 2015 This should now be sorted in the 2.7.2 b400 pre-release, available in Alfred's update prefs
Florian Posted August 19, 2015 Author Posted August 19, 2015 I am super happy about this ! Really it's cool ! There is still an annoyance though... (sorry Andrew :-( ) in the form of the following: say I'm watching a TV series on my computer using the MPV player, one episode is about to end, so I pop Alfred up and start to look for the next episode. But MPV has the particularity of quitting when a video is over, thus giving the focus to the next application and escaping Alfred in the process. Could there be a way for Alfred to remain active while the frontmost application changes?
Andrew Posted August 20, 2015 Posted August 20, 2015 I am super happy about this ! Really it's cool ! There is still an annoyance though... (sorry Andrew :-( ) in the form of the following: say I'm watching a TV series on my computer using the MPV player, one episode is about to end, so I pop Alfred up and start to look for the next episode. But MPV has the particularity of quitting when a video is over, thus giving the focus to the next application and escaping Alfred in the process. Could there be a way for Alfred to remain active while the frontmost application changes? In it's current form, this is a really hard thing for Alfred to differentiate from the standard behaviour (of close on focus lost)... I do have a ticket for it, but it may be a bit involving to fix so wouldn't be in a maintenance style release.
wolph Posted August 20, 2015 Posted August 20, 2015 Wow, works great Thanks Andrew! As for losing focus, while that's indeed an annoyance it might be preferable behaviour to the potential bugs after fixing it. Switching applications and purposefully defocussing Alfred might not be possible otherwise. At the very least that should have to be configurable.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now