In a Cocoa app, is there a way to tell if another application currently is in full screen mode?
My application is configured to show up on all Spaces and listens for mouseEntered
events to order itself to the front.
Problem is that when another app is in full screen mode and the user happens to move the mouse across the black area where my app's window is located, it is brought to the front (happens with multiple monitors).
I've only seen the above behavior with [self setCollectionBehavior: NSWindowCollectionBehaviorCanJoinAllSpaces];
enabled.
Here the other relevant code for my app.
- (void) mouseEntered:(NSEvent *)theEvent
{
// Don't do this when another app is in full screen mode:
[[self window] orderFront:self];
}
To stop using the app full screen, move the pointer to the green button again, then choose Exit Full Screen from the menu that appears or click the button .
By default, any application that you start on your Mac will open in the same size that you used it last time, except for full screen mode, which you always have to set manually. This can be changed from setting. Go into System Preferences, click on General, and uncheck the «Close windows when exiting an app«.
Move the cursor to any one of the four corners of the Window. When the cursor icon changes to a diagonal bi-directional arrow, press and hold the Option key and double click. This would zoom the window to occupy the entire screen without it entering into full-screen mode.
The above mentioned methods of registering for
"NSWindowWillEnterFullScreenNotification"
does not work, they can be used to notify your own app, using them we cannot detect whether any other application is in full screen mode or not.
However After trying out so many options found out FullScreen detector app at github this usefull link ..:):)
https://github.com/shinypb/FullScreenDetector.git
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With