Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS X Lion: Detect if another application is running in full screen mode?

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];
}
like image 428
Mark Avatar asked Aug 21 '11 12:08

Mark


People also ask

How do I close full screen applications on Mac?

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 .

How do I make apps open automatically in full screen Mac?

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«.

How do I maximize a window in Mac without full screen?

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.


1 Answers

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

like image 64
sandy Surname or Initialc Avatar answered Sep 28 '22 12:09

sandy Surname or Initialc