'Is it possible to use CGWindowListCopyWindowInfo to get the most previous window displayed?
Is it possible to use CGWindowListCopyWindowInfo to get the most previous window displayed?
I found the following question but could not get the most previous window displayed.
If there is an app that does not have an open window, information about that app will be included before the window that is displayed at the very front.
Front most window using CGWindowListCopyWindowInfo
Solution 1:[1]
CGWindowListCopyWindowInfo(
kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements,
kCGNullWindowID
)
The windows were indeed in order when I did the above as per the linked question in the question text.
I then checked and found that the topmost window has the Dock in front of it.
Now I know which one is at the top.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | tasuren |
