diff options
Diffstat (limited to 'video')
-rw-r--r-- | video/out/cocoa-cb/events_view.swift | 5 | ||||
-rw-r--r-- | video/out/cocoa-cb/window.swift | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/video/out/cocoa-cb/events_view.swift b/video/out/cocoa-cb/events_view.swift index 73ccba527f..124a7a028d 100644 --- a/video/out/cocoa-cb/events_view.swift +++ b/video/out/cocoa-cb/events_view.swift @@ -179,6 +179,11 @@ class EventsView: NSView { } } + override func magnify(with event: NSEvent) { + cocoaCB.layer?.inLiveResize = event.phase == .ended ? false : true + cocoaCB.window?.addWindowScale(Double(event.magnification)) + } + func signalMouseDown(_ event: NSEvent) { signalMouseEvent(event, MP_KEY_STATE_DOWN) if event.clickCount > 1 { diff --git a/video/out/cocoa-cb/window.swift b/video/out/cocoa-cb/window.swift index 03ea17da57..2dbac9751d 100644 --- a/video/out/cocoa-cb/window.swift +++ b/video/out/cocoa-cb/window.swift @@ -461,6 +461,12 @@ class Window: NSWindow, NSWindowDelegate { mpv?.command("set window-scale \(scale)") } + func addWindowScale(_ scale: Double) { + if !isInFullscreen { + mpv?.command("add window-scale \(scale)") + } + } + func windowDidChangeScreen(_ notification: Notification) { if screen == nil { return |