Detecting fullscreen on Mac

后端 未结 4 1352
梦谈多话
梦谈多话 2021-01-22 18:53

I am writing an IM client for Mac (in Python, but an Objective C / Cocoa solution here is fine). I want to detect whether or not the user is currently watching a movie or playin

4条回答
  •  情话喂你
    2021-01-22 19:33

    To check for full-screen, call CGDisplayIsCaptured(screenID) on each screen.

    But I'm not sure if you're checking the right thing. For one thing, I could have one screen captured ("full screen") and a second screen uncaptured, what do you want to do in this case?

    Also, does fullscreen really mean anything? If I'm using GarageBand to work on a song, I probably don't want to hear random sounds, regardless of whether or not anything's full screen. Or I could be running a Windows VM full-screen, but still want to be notified of IMs.

提交回复
热议问题