How do find out if there is a full-screen app running on a specific NSScreen

thomasfuchs

In Cocoa/AppKit, given a screen from [NSScreen screens], how can I find out if there's a full-screen app running on that specific screen? I'm mostly interested in apps that use the Cocoa APIs for full-screen, but if there's a solution that also encompasses other types of full-screen apps, even better. The solution needs be able to pass Mac App Store approval.

My specific use case involves a menu bar app (NSStatusItem) and figuring out whether or not a menubar is shown at all on [NSScreen mainScreen] in order to allow a global keyboard shortcut to show either a popover positioning on the status item (if it's visible) or a floating window if there's no visible status item.

NSScreens themselves don't seem to expose any information about windows/apps, and NSRunningApplication doesn't expose this information either.

Are there perhaps Carbon APIs for finding this out? For example, if I have a list of windows, I could iterate through them and see if any window frames match the screens' frame exactly. On the other hand, there might be apps that have a frame like that but run underneath other apps (like the Backdrop app, https://itunes.apple.com/us/app/backdrop/id411461952?mt=12), so an approach like this would need to look at window levels.

Ken Thomases

You can try the CGWindowList API, such as CGWindowListCopyWindowInfo().

If you just want to know if the menu bar is showing, you should be able to check -[NSApplication currentSystemPresentationOptions] for NSApplicationPresentationAutoHideMenuBar or NSApplicationPresentationHideMenuBar. That method can also tell you if the active app is in Cocoa full-screen mode (NSApplicationPresentationFullScreen).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do find out if there is a full-screen app running on a specific NSScreen

From Dev

NSScreen get the projector/TV Out/AirPlay screen?

From Dev

How to find out if the video is currently playing in full screen on OS X

From Dev

How do I find out the name of the font used to display some specific text on the screen?

From Dev

How do I toggle a full screen Swing frame out of full screen mode?

From Dev

How do I find out Groovy runtime version from a running app?

From Dev

How to find out what a specific at job will do?

From Dev

iPad and email link - how do close the full screen mail app?

From Dev

Is the app minimized or has the screen been switched off, how to find out?

From Dev

How do I find out the kernel version I am running?

From Java

Tmux: How do I find out the currently running version of tmux?

From Dev

How do I find out the kernel version I am running?

From Dev

How do I find out command line arguments of a running program?

From Dev

How do I find out a specific row ID from a table?

From Dev

How to let full-screen be on specific monitor?

From Dev

How can I visually find out which programs are running on the current virtual screen in Unity?

From Dev

App does not launch in full screen when running on iOS 7.1?

From Dev

Android: phonegap/cordova: switch full screen mode while app is running

From Dev

Android: phonegap/cordova: switch full screen mode while app is running

From Dev

App does not launch in full screen when running on iOS 7.1?

From Dev

How do I find the postgres version running on my heroku app?

From Dev

How do I find out and stop server Rails app

From Dev

How to quit a full screen web app

From Dev

How do you find out what Firefox Profile is running when Firefox is running?

From Dev

How do I keep my Cordova app full-screen when opening the Android keyboard?

From Dev

How do I find a specific installed app on the device?

From Dev

Find out which command is running within a screen session

From Dev

Find out which command is running within a screen session

From Dev

How can I find out which version of Cassandra a specific DSE is running?

Related Related

  1. 1

    How do find out if there is a full-screen app running on a specific NSScreen

  2. 2

    NSScreen get the projector/TV Out/AirPlay screen?

  3. 3

    How to find out if the video is currently playing in full screen on OS X

  4. 4

    How do I find out the name of the font used to display some specific text on the screen?

  5. 5

    How do I toggle a full screen Swing frame out of full screen mode?

  6. 6

    How do I find out Groovy runtime version from a running app?

  7. 7

    How to find out what a specific at job will do?

  8. 8

    iPad and email link - how do close the full screen mail app?

  9. 9

    Is the app minimized or has the screen been switched off, how to find out?

  10. 10

    How do I find out the kernel version I am running?

  11. 11

    Tmux: How do I find out the currently running version of tmux?

  12. 12

    How do I find out the kernel version I am running?

  13. 13

    How do I find out command line arguments of a running program?

  14. 14

    How do I find out a specific row ID from a table?

  15. 15

    How to let full-screen be on specific monitor?

  16. 16

    How can I visually find out which programs are running on the current virtual screen in Unity?

  17. 17

    App does not launch in full screen when running on iOS 7.1?

  18. 18

    Android: phonegap/cordova: switch full screen mode while app is running

  19. 19

    Android: phonegap/cordova: switch full screen mode while app is running

  20. 20

    App does not launch in full screen when running on iOS 7.1?

  21. 21

    How do I find the postgres version running on my heroku app?

  22. 22

    How do I find out and stop server Rails app

  23. 23

    How to quit a full screen web app

  24. 24

    How do you find out what Firefox Profile is running when Firefox is running?

  25. 25

    How do I keep my Cordova app full-screen when opening the Android keyboard?

  26. 26

    How do I find a specific installed app on the device?

  27. 27

    Find out which command is running within a screen session

  28. 28

    Find out which command is running within a screen session

  29. 29

    How can I find out which version of Cassandra a specific DSE is running?

HotTag

Archive