mirror of https://github.com/mpv-player/mpv
cocoa-cb: fix optional cases on macOS 10.12
This commit is contained in:
parent
4a8bf91d4c
commit
0602f082cb
|
@ -260,18 +260,18 @@ class Window: NSWindow, NSWindowDelegate {
|
||||||
if state {
|
if state {
|
||||||
if ontopLevel is Int {
|
if ontopLevel is Int {
|
||||||
switch ontopLevel as? Int {
|
switch ontopLevel as? Int {
|
||||||
case -1:
|
case .some(-1):
|
||||||
level = Int(CGWindowLevelForKey(.floatingWindow))
|
level = Int(CGWindowLevelForKey(.floatingWindow))
|
||||||
case -2:
|
case .some(-2):
|
||||||
level = Int(CGWindowLevelForKey(.statusWindow))+1
|
level = Int(CGWindowLevelForKey(.statusWindow))+1
|
||||||
default:
|
default:
|
||||||
level = ontopLevel as? Int ?? stdLevel
|
level = ontopLevel as? Int ?? stdLevel
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch ontopLevel as? String {
|
switch ontopLevel as? String {
|
||||||
case "window":
|
case .some("window"):
|
||||||
level = Int(CGWindowLevelForKey(.floatingWindow))
|
level = Int(CGWindowLevelForKey(.floatingWindow))
|
||||||
case "system":
|
case .some("system"):
|
||||||
level = Int(CGWindowLevelForKey(.statusWindow))+1
|
level = Int(CGWindowLevelForKey(.statusWindow))+1
|
||||||
default:
|
default:
|
||||||
level = Int(ontopLevel as? String ?? "") ?? stdLevel
|
level = Int(ontopLevel as? String ?? "") ?? stdLevel
|
||||||
|
|
Loading…
Reference in New Issue