<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGWindowListOption/optionOnScreenOnly",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@E@CGWindowListOption@kCGWindowListOptionOnScreenOnly"
  },
  "title" : "optionOnScreenOnly"
}
-->

# optionOnScreenOnly

```
static var optionOnScreenOnly: CGWindowListOption { get }
```

## Discussion

List all windows that are currently onscreen. Windows are returned in order from front to back. When retrieving a list with this option, the `relativeToWindow` parameter should be set to [`kCGNullWindowID`](/documentation/CoreGraphics/kCGNullWindowID).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)