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

Hmm, have you ruled out using applescript/scriptingbridge? You can get the size of windows from applescript and compare them to the size of the screen. (or do you not know which screen a given app is on?)
Certain apps which are accessible will have an 'AXFullScreen' attribute on their windows. For example this works for some apps:

  tell application "System Events"
    tell process "Pages"
        repeat with myWin in windows
            get value of attribute "AXFullScreen" of myWin
        end repeat
    end tell 
end tell

The real action seems to be down in carbon... MacWindows.h and CarbonEvents.h have references to "FullScreen" in them.

You will need to research this though.


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


After a great deal of frustration, this worked for me to get a window that floats on all spaces except full-screen ones. I saw the fullScreenNone constant name, and since it described what I wanted, I tried it and found that it worked.

    window.level = .floating
    window.collectionBehavior = [.canJoinAllSpaces, .fullScreenNone]
    window.canHide = false