How to force an NSWindow to be in front of every app? Even fullscreen apps

nsview
nswindowcontroller
nsapplication
electron always on top
nswindow beginsheet example
nspanel
nswindowdelegate
nswindow show

I have an NSWindow that i would like to have it in front of everything (every app of the computer, fullscreen apps, etc..). Even if i click in a background app, the NSWindow cant go to background. And the NSWindow must follow the user screen if, for example, the user switches the desktop to desktop2, and so on... How can i do that? Thanks!

If you don't need to be visible with other apps' full-screen windows, it's not too hard.

First, to stay in front of everything else, just setLevel: with NSFloatingWindowLevel or higher. Experiment with the different values to see which seems appropriate to your needs.

Next, to stay in front even when the user changes Spaces, possibly including Exposé/Mission Control, setCollectionBehavior: with the appropriate pair of flags, or use the corresponding Spaces and Exposé settings in the Attributes Inspector if you're creating the window in the nib. Either Can Join All Spaces or Move to Active Space will make sure you stay visible on every space, in slightly different ways. You'll probably want Exposé set to Stationary, or possibly Transient, too. Again, try both ways and see.

However, Lion will hide both all-spaces and move-to-active-space windows when the user switches to a full-screen space or to Dashboard or Launchpad. And if you watch, you'll see that it does this in different ways for each of the three cases. And that Snow Leopard does things a little differently, and so does Mountain Lion.

If you want to solve that last problem, you need a bit of hackery—and different forms of hackery for each case and for each OS version. The basic trick is to catch the hide-related notifications and unhide yourself at the appropriate time.

alwaysOnTop over other fullscreen apps · Issue #10078 · electron , It put a small overlay over any fullscreen app. To set NSWindowCollectionBehaviorFullScreenAuxiliary in Electron app, call setFullScreenable(false) . Fix SetVisibleOnAllWorkspaces to show app over Fullscreen apps too #11599 even the default (0) is high enough to show in front when focused. NSWindow / NSPanel can't show in front of full-screen application 0 Objective equivalent to AppleScript : Opening directory without bringing every finder window to from

You should modify your info.plist and set the Application is Agent flag to YES. An agent's window can be displayed in front of fullscreen windows.

NSWindow, user's screen everywhere he goes (the NSWindow stays in front of every app, no matter what, even fullscreen apps). In that NSWindow i have  For completeness here is what the category on NSWindow would look like: @implementation NSWindow (CategoryNSWindow) #pragma mark - Full Screen Mode: - (BOOL) inFullScreenMode { return (self.styleMask & NSFullScreenWindowMask); } @end These two methods will enable / disable the ability to go into or out of full screen mode:

Setting both, "Application is agent (UIElement)" to "YES" in info.plist

& window level :

self.view.window?.level = NSWindow.Level(rawValue: kCGMainMenuWindowLevel.hashValue - 1)
self.view.window?.collectionBehavior = [.stationary, .canJoinAllSpaces, .fullScreenAuxiliary]

helped me.

BrowserWindow, A window that an app displays on the screen. Takes the window into or out of fullscreen mode, Returns the window numbers for all visible windows satisfying the specified options. Moves the window to the front of its level, even if its application isn't active, without changing FrameAutosaveName, force: Bool) -> Bool. Always On Top forces selected windows to stay on top. It's free, it's easy, and it works. I tested it on my Windows 7 x64 machine. Just run the utility, click the window you want to keep on top

Any nice, stable ways to keep a window 'Always on top' on the Mac , Moves the window to the front of its level, even if its application isn't active, without changing either the key window or the main window. - orderWindow:​relativeTo:. I created a little xcode app to test and I can make a regular NSWindow that opens on the nearest desktop and an NSPanel that opens on top of the current fullscreen app. I've only started looking into modifying electron to allow BrowserWindow to create an NSPanel but so far it looks like it won't be a trivial change.

How to check if a NSWindow is visible - objective-c - javascript, For a complex app, the ready-to-show event could be emitted too late, making the app feel slow. Note that even for apps that use ready-to-show event, it is still recommended to set On all platforms, the visibility state tracks whether the window is simpleFullscreen Boolean (optional) - Use pre-Lion fullscreen on macOS. The keyboard shortcut Windows-Shift-Enter toggles the active Windows 10 application between normal and fullscreen mode. The Microsoft Edge window looks like this in fullscreen mode for instance. If you hover the mouse cursor over the (hidden) taskbar area, you will notice that it is revealed.

High Caffeine Content, Bug ID 32852924: Xcode 9 iOS Simulator is missing the "Stay in Front" option. 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: (lldb) e NSWindow *$window = [(NSArray *)[NSApp windows] firstObject] (lldb) po $​window  How to Display UWP Apps in Full Screen View in Windows 10 Universal Windows apps (aka: modern apps) can now be opened in resizable windows on your desktop like any other app now in Windows 10. When you display a universal app in full screen view, it will not always stay that way.

Comments
  • Thank you so much! I set the level to NSFloatingWindowLevel, Spaces: Can Join All Spaces and Exposé: Transient Behavior and it's working just the way i wanted! the NSWindow is following me everywhere. Thank you!
  • One last thought: It may be more appropriate to use an NSPanel instead of an NSWindow (and possibly to use setFloatingPanel:YES instead of setLevel:NSFloatingWindowLevel).
  • Agent windows have other side effects, so not ideal. Also, this seems to mean the app is stuck on the full screen it was born in.