In Cocoa / AppKit, from the screen [NSScreen screens], how can I find out if there is a full-screen application running on that particular screen? Mostly I'm interested in applications that use Cocoa APIs for full-screen mode, but if there is a solution that also includes other types of full-screen applications, it's even better. The solution should be able to pass Mac App Store approval.
My specific use case involves applying a menu bar ( NSStatusItem) and figuring out whether the [NSScreen mainScreen]menu is generally displayed on [NSScreen mainScreen], so that the global key combination can display either the position of the pop-up window on the status element (if it is visible) or a floating window if there is no visible state element.
They themselves NSScreensdo not provide any information about windows / applications, and NSRunningApplicationalso does not disclose this information.
Perhaps there is a Carbon API to find out? For example, if I have a list of windows, I could go through them and see if any of the window frames exactly fit the screen frame. On the other hand, there may be applications that have a similar structure, but work under other applications (for example, the Backdrop application, https://itunes.apple.com/us/app/backdrop/id411461952?mt=12 ), so the approach is, like this, would have to consider window levels.
source
share