c++macoscore-graphicskeynote

How can I tell which fullscreen Keynote window is the presentation?


When there are multiple displays and a Keynote presentation is started, it creates a fullscreen window on each display. Only one of these is the presentation and the other(s) contain e.g. a timer, but all have the same CGWindowName.

How can I find which CGWindowID corresponds to the presentation?
Ideally in C++ please, thanks in advance.


Solution

  • The best way I've found so far is by comparing the CGWindowLayers. The presentation appears to always have the higher window layer, although I don't know if that's guaranteed.