150

I am looking for a stable way to keep any window 'always on top' on OSX.

Afloat, an app that does that requires SIMBL/easySIMBL, which it seems is not very stable.

Are there any better solutions? It's actually surprising that there is no native way to implement this.

Himanshu P
  • 3,432

13 Answers13

46

I'll note that the iOS Simulator has the option Stay On Top (formerly called Stay in Front). Extremely useful functionality, and proves that there are Apple-supported and sanctioned ways to achieve this behavior.

Might be worth opening a radar, especially for adding to Terminal.

You can duplicate my radar:

Bug ID 27430873: Add "Stay in Front" option to Terminal windows.

Stay in Front option in iOS Simulator

Apple's Activity Monitor app similarly has the option Keep CPU Windows on Top that floats the small CPU graphs on top of all other apps' windows:

Activity Monitor > Window > Keep CPU Windows on Top

pkamb
  • 8,791
  • 4
    What is this iOS simulator? Is it like an emulator? I have been looking for one. – voices Mar 04 '17 at 12:54
  • 1
    @tjt263 the iOS simulator is bundled with Xcode and mainly used to develop iOS apps – pkamb Mar 05 '17 at 06:36
  • 4
    Oh ok. What's a radar? Like a bug report? – voices Mar 05 '17 at 08:14
  • @tjt263 yes, https://bugreport.apple.com – pkamb Mar 05 '17 at 17:35
  • 3
    This functionality is also shown in the pre-installed 'Activity Monitor' - if you go to the 'Window' menu, you'll see an option to 'Keep CPU Windows on Top' - so it does indeed seem like there's an official Apple way to do this. (This is what I see on 10.13.2) – keybits Dec 15 '17 at 11:48
  • Strange, my iOS simulator has no option to stay in front – Sudara Aug 09 '18 at 09:31
  • @Sudara yes, unfortunately it was removed in Xcode 9 when they began allowing multiple simulators. Please see my edit and duplicate my radar. – pkamb Aug 09 '18 at 17:53
  • 2
    Oh, Apple :( ... Keep CPU Windows on Top doesn't even work, in Mojave, although the option is still present in the menu. Another bug :/ – TryTryAgain Feb 07 '20 at 06:45
27

If you are looking to do this just for a say an internet browser window you could look at the open source Helium app. It's free, and you can also download the source and compile your own version if you want.

It's basically an internet browser that always floats above all other windows. Helium App

EDIT:

There's also a newer app from the Apple Mac App Store called Fluid Browser that will do this same thing. It does cost a couple of $s, but it works excellently and has a few more features than Helium (as of 7/6/2016). So you now have two different apps to choose from.

Fluid Browser

kenjikato
  • 1,634
  • I did not like the Fluid Browser experience. Yes, it has a few more features but it's pretty buggy and cumbersome. Helium is very lightweight but does the job. – P A N Nov 01 '16 at 13:21
  • 2
    Can you block ads in Helium or Fluid? – powder366 Feb 05 '17 at 12:33
  • How do you get the fluid browser on top? It just makes it a launcher. What the hell. – mjs Apr 10 '22 at 07:38
15

If you are a developer and your SIP is disabled (csrutil) one can change level property of NSWindow using lldb. Once you attach to process (i.e. App Store) in XCode just type:

(lldb) e NSWindow *$window = [(NSArray *)[NSApp windows] firstObject]
(lldb) po $window
<NSWindow: 0x600000d64200>

(lldb) po [$window setLevel:3]
resume debugging

PS: If app has multiple windows get the correct one using command

(lldb) po [NSApp windows]

To return back just close window or use

(lldb) po [$window setLevel:0]

enter image description here enter image description here

Marek H
  • 529
  • 1
    This is pretty neat, I wonder if there is an equally simple way to adjust transparency? – Steven Lu Mar 26 '20 at 07:29
  • This is a nice proof of concept, but I don't like the fact, that we have to disable SIB to get the desired effect. It's hard to believe that this is not possible in an easier fashion. I guess this is what the slogan "Think different" is all about, once more ... – Martin Braun Apr 23 '21 at 12:58
13

If you're looking to watch video while you browse or use other applications, you can use the Picture-in-Picture Extension (by Google) for Chrome.

  • 4
    Oh my gosh this is better than I could have hoped for. Just wanted Netflix playing in the corner while I work. I love that the browser window frame disappears but wish Netflix's back & forward buttons and subtitles stayed – velkoon Mar 23 '20 at 02:09
  • 1
    Videos? The issue is web development. I need a full browser or any window really to stay on top. – mjs Apr 10 '22 at 07:33
7

I've just given up on mySIMBLE and afloat. Fenêtre is a paid for app with a free lite version that works really well.

I use it to play videos window in window while I work or to keep online instructions on top. Not sure what you want to use it for?

Nimesh Neema
  • 51,809
Rudolf
  • 71
  • Keeps insisting on repositioning itself on every browser click. Annoying as hell. Other than was promising but can not use now. Forcing it to a particular place is not a good option. – mjs Apr 10 '22 at 07:30
5

If you only really want/need "stay on top" functionality for your Terminal.app window (like myself), there is a Quake/Guake-style drop-down visor, SIMBL plug-in available that supports being pinned to the foreground; TotalTerminal.

So it's possible, despite the common misconception that it's not.

As of MacOS 10.11 (El Capitan), to install/run TotalTerminal, you might need to disable System Integrity Protection:

csrutil enable --without debug

It's no longer open source, but the last open source implementation is still available on GitHub. So if you're inclined to, you could investigate exactly how it's achieved. I emailed the developer to ask, but it's been so long since they worked on it, they couldn't (or wouldn't?) really tell me.

voices
  • 2,209
  • 1
    TotalTerminal is no longer maintained these days. I ended up switching to iTerm to get the same behavior: https://apple.stackexchange.com/questions/48796/iterm-as-a-slide-out-terminal-from-the-top-of-the-screen – André Morujão Jul 04 '17 at 09:25
  • That's right, I wouldn't suggest using it. But if someone is motivated to implement their own solution, it might be worth browsing the linked source code. – voices Jul 06 '17 at 00:11
  • For floating terminal, I am using Helium with gotty. gotty allows you to open a terminal in web browser and Helium is a floating web browser. – wesley6j Jul 13 '17 at 14:25
  • You really, really, really, and I really really mean really do, need to note that you should re-enable SIP after doing what you document. – Pryftan Feb 23 '19 at 16:25
  • @Pryftan nah, SIP is for pussies. – voices Feb 24 '19 at 08:42
  • @tjt263 Apparently you don't understand the principle of least privilege. But just because you don't doesn't mean it shouldn't be noted for other people. Oh it's true that this is a bit different but that's not the point. The point also is that many people can use all the help they can get. You may think you're invincible but you're not. Everyone can be bested. Every single person can eventually be bested. But sure, carry on and be insolent and haughty. Doesn't make you right though. Omitting information from a sequence of steps is worse than no steps at all and that's what you've done. – Pryftan Feb 26 '19 at 01:12
5

Full disclosure, I am the developer of the app.

My app lets you float multiple windows consisting of images, videos, pdfs, text based files, websites, YouTube/Netflix/Vimeo/Twitch etc:

https://apps.apple.com/us/app/floating-picture-in-picture/id1508833245

  • How about a browser? – mjs Apr 10 '22 at 07:32
  • Just checked out your app. Looks like the best replacement yet now that Helium is no longer maintained and buggy. I may very likely buy this. A question, btw: back in Helium you could resize content without resizing the window. For example making text bigger without making window bigger. Would you be adding that in? – RexYuan Nov 11 '22 at 21:47
  • 1
    @RexYuan could you email me from the app if I miss your message? As for the resize content feature, I have been thinking of adding keyboard shortcuts like Ctrl+ and Ctrl- to do that. What do you think? – sudoExclamationExclamation Nov 13 '22 at 23:09
  • @sudoExclaimationExclaimation Sent you an email. Ctrl or cmd +/- commands sound very nice. Thanks for considering the feedback! – RexYuan Nov 16 '22 at 16:35
  • @sudoExclaimationExclaimation can you make it keep Google Meet browser window on top while not affecting other windows from Chrome? Getting google meet lost is a very common issue these days. – sorin Dec 06 '22 at 13:40
  • @sorin I will have to see if it's possible or not. I think if it's possible, then I would have to use a non-app store way of distributing it as it would most likely require use of private APIs. I will see what I can do. – sudoExclamationExclamation Dec 06 '22 at 21:34
  • Why can't you sell your app without the AppStore? – Martin Braun Oct 24 '23 at 00:13
  • @MartinBraun I probably could. Is that something you would like? – sudoExclamationExclamation Nov 25 '23 at 19:47
  • @sudoExclaimationExclaimation Yes, absolutely. I use macOS for development purposes and I kinda enjoy the platform in general. However, I do not enjoy the deployment of apps via Apple AppStore. I don't want to sign in and I don't support the high fees you have to pay them, I want to use brew install --cask yourappname and be asked to enter a license key that I can buy, instead. This way you don't even owe Apple a slice from the pie. – Martin Braun Nov 27 '23 at 23:18
  • 1
    @MartinBraun Thanks. I will look into doing that too. – sudoExclamationExclamation Nov 28 '23 at 02:13
3

Not really an answer but more like a work-around: you can use Spectacle or a similar app to quickly setup a desktop layout that let you follow the original window.

Of course this won't help when you're waiting for someone else to join a support chat and in the meanwhile decide to use your time for something more useful than staring at a blank window -- like working on another virtual desktop :(

Grab Spectacle from here: https://www.spectacleapp.com

i90rr
  • 41
  • Welcome to Ask Different and taking the time to post an answer. As a suggested improvement, your should provide links to the application(s) that you reference in your post. It makes for a better user experience. For more information on crafting a good answer see: http://apple.stackexchange.com/help/how-to-answer – Allan May 03 '16 at 15:46
  • 2
    Hello Allan, thank you very much for helping make AskDifferent a neat and tidy place, I will follow your instructions. Cheers. – i90rr May 05 '16 at 18:49
3

There is a free app called Key Codes in the Mac App Store that as far as I can tell stays on top of all other windows. Other than menu items it stays atop all other apps including the Terminal and the Safari URL bar.

Seamus
  • 51
  • 19
    Brilliant tip Seamus if the op specifically needs that particular app to stay on top. Now, if, hypothetically speaking of course, he wants a different app to stay on top, or perhaps even few different ones, then perhaps not so sterling? – mysomic Dec 02 '16 at 22:01
  • 3
    Thanks! Works great for the use case "please occlude this ghastly thing". – ecmanaut Mar 03 '18 at 15:27
  • @mysomic i agree. – mjs Aug 28 '21 at 08:42
  • I am also working on an app that stays on top. But unfortunately its for my client's personal use who is an astronaut, and can I add that app as an answer to this question? – Muhammad bin Yusrat Jun 07 '22 at 08:00
3

BetterTouchTool just added support for keeping a window on top (the "Pin/Unpin Focused Window To Float On Top" action). I can't comment, yet, on how stable that particular feature is. I just enabled it today. Works well so far.

BetterTouchTool is not a free tool, but not expensive and is worth every penny! It does everything.

Troy
  • 474
2

just drag your terminal, over the safari window, after typing the F3.

this automatically arranges the terminal, vertically, on the right side of the safari window, for example... so you can do some work and have access to the terminal, while in another window...

Anda
  • 21
2

BetterTouchTool (https://folivora.ai) now has an option to keep a window floating. The action is called "Pin/Unpin Focused Window to Float on Top" It works with most windows, but not with DRMed video content like Netflix. (It basically floats a live video stream of the backgrounded window on top)

Nanunana
  • 111
0

It's use case specific, but for images or text I always want on top I create a Sticky and have it float. It can't float over full-screen apps, but it's a quick stable fix.

OrigamiEye
  • 426
  • 3
  • 13