10

I get a list of CGWindows using CGWindowListCreate as shown below:

CFArrayRef windows = CGWindowListCreate(kCGWindowListOptionOnScreenOnly, 0);

Is there a way to tell which NSScreen each window is on? I've trying looking at the intersection of window bounds and the frames of the screens, but if a window is partially off screen it can intersect with the frame of another screen.

Is there a more reliable way to do this?

DanielGibbs
  • 9,910
  • 11
  • 76
  • 121

0 Answers0