Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSWindow in front of every app and in front of the menu bar Objective-c Mac

How can I make my NSWindow appear in front of every app and the menubar? I also don't want a title bar on my window. Just a fullscreen app without the dock menubar and not in apple's fullscreen mode. I can get my window above all of the other apps and dock like this:

[window setLevel:kCGPopUpMenuWindowLevel];

but it doesn't cover the mac menubar.

like image 909
atomikpanda Avatar asked Dec 20 '22 14:12

atomikpanda


1 Answers

You can't move a default window higher that the menu bar, because it's constrained. You have to subclass NSWindow and override constrainFrameRect:toScreen:

- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen {
    return frameRect;
}
like image 163
DrummerB Avatar answered Jan 03 '23 17:01

DrummerB