AnsweredAssumed Answered

Multiple monitors: how can I check if a window is on-screen?

Question asked by ehall on Jan 28, 2015
Latest reply on Jan 29, 2015 by philmodjunk

Title

Multiple monitors: how can I check if a window is on-screen?

Post

When a user has a single display, it's easy to calculate whether the current window is visible on the screen (or partially on-screen) using Get(WindowLeft), Get(WindowWidth), Get(ScreenWidth), and so on.

If a user has multiple monitors, this approach breaks down. Get(WindowLeft) and Get(WindowTop) are relative to the primary monitor, so a negative number might mean that the window is off-screen, or it might mean that the window is visible on a secondary monitor at the left of their primary monitor.

Is there any way to check which is actually the case? Is there any way to find out whether the system has more than one monitor at all? Are there other tricks for keeping windows visible (or not) in a multi-display environment?

We're on OS X.

Outcomes