cocoa-cb: fix optional cases on macOS 10.12

This commit is contained in:
der richter 2019-05-10 22:01:15 +02:00 committed by Jan Ekström
parent 4a8bf91d4c
commit 0602f082cb
1 changed files with 4 additions and 4 deletions

View File

@ -260,18 +260,18 @@ class Window: NSWindow, NSWindowDelegate {
if state {
if ontopLevel is Int {
switch ontopLevel as? Int {
case -1:
case .some(-1):
level = Int(CGWindowLevelForKey(.floatingWindow))
case -2:
case .some(-2):
level = Int(CGWindowLevelForKey(.statusWindow))+1
default:
level = ontopLevel as? Int ?? stdLevel
}
} else {
switch ontopLevel as? String {
case "window":
case .some("window"):
level = Int(CGWindowLevelForKey(.floatingWindow))
case "system":
case .some("system"):
level = Int(CGWindowLevelForKey(.statusWindow))+1
default:
level = Int(ontopLevel as? String ?? "") ?? stdLevel