Following the definition chain:
#define NSScreenSaverWindowLevel kCGScreenSaverWindowLevel
and...
#define kCGScreenSaverWindowLevel CGWindowLevelForKey(kCGScreenSaverWindowLevelKey)
I think the corrected answer is:
window.level = Int(CGWindowLevelForKey(Int32(kCGScreenSaverWindowLevelKey)))
a lot of casting due to inconsistencies in the listing types
source share