diff options
Diffstat (limited to 'video/out/cocoa-cb/events_view.swift')
-rw-r--r-- | video/out/cocoa-cb/events_view.swift | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/video/out/cocoa-cb/events_view.swift b/video/out/cocoa-cb/events_view.swift index 7cc6a4022d..5a84d27b2b 100644 --- a/video/out/cocoa-cb/events_view.swift +++ b/video/out/cocoa-cb/events_view.swift @@ -31,9 +31,9 @@ class EventsView: NSView { override var acceptsFirstResponder: Bool { return true } - init(frame frameRect: NSRect, cocoaCB ccb: CocoaCB) { + init(cocoaCB ccb: CocoaCB) { cocoaCB = ccb - super.init(frame: frameRect) + super.init(frame: NSMakeRect(0, 0, 960, 480)) autoresizingMask = [.viewWidthSizable, .viewHeightSizable] wantsBestResolutionOpenGLSurface = true register(forDraggedTypes: [NSFilenamesPboardType, NSURLPboardType]) @@ -233,7 +233,7 @@ class EventsView: NSView { topMargin = cocoaCB.window.titleBarHeight + 1 + menuBarHeight } - var vF = window!.screen!.frame + guard var vF = window?.screen?.frame else { return false } vF.size.height -= topMargin let vFW = window!.convertFromScreen(vF) @@ -249,6 +249,7 @@ class EventsView: NSView { } func canHideCursor() -> Bool { + if cocoaCB.window == nil { return false } return !hasMouseDown && containsMouseLocation() && window!.isKeyWindow } |