kCGNullWindowID undefined in Swift

Originator:tternes
Number:rdar://21783330 Date Originated:11-Jul-2015 05:37 PM
Status:Open Resolved:
Product:OS X SDK Product Version:
Classification:Other Bug Reproducible:Always
 
Summary:
The CoreGraphics Swift interfaces do not contain a definition for kCGNullWindowID, though the documentation mentions it numerous times.

Steps to Reproduce:
Attempt to use the following code snippet:

        let windowList: NSArray! = CGWindowListCopyWindowInfo(CGWindowListOption.OptionOnScreenOnly, kCGNullWindowID)

Build in Xcode (tested using Version 7.0 beta (7A121l)).

Please see attached Xcode project which demonstrates the issue.

Expected Results:
There are two possible expectations:
- kCGNullWindowID should be defined, since the documentation mentions it several times. When defined, compilation of the mentioned line should succeed.
- A proper value for Swift should be defined, and the documentation should be updated to reflect this definition, instead of calling out kCGNullWindowID.

Actual Results:
The swift compiler emits the following error when building: main.swift:12:101: error: use of unresolved identifier 'kCGNullWindowID'

Regression:
Describe circumstances where the problem occurs or does not occur, such as software versions and/or hardware configurations.

Notes:
Using 0 in place of kCGNullWindowID seems to be a suitable workaround (since that’s how it was #defined in the C headers). However, that value isn’t properly documented. A proper value should be described in the documentation.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!