summaryrefslogtreecommitdiffstats
path: root/video/out/cocoa_cb_common.swift
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2018-03-05 02:11:25 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-03-04 19:08:45 -0800
commit8bfeecbc6ff1c95682b908a7e4beb87dd83fb3b7 (patch)
treed7ea113b48d896437ab4e7c8f0135e3a05e8fade /video/out/cocoa_cb_common.swift
parent33cffdcbac354179756db732c03b87026f710e8e (diff)
downloadmpv-8bfeecbc6ff1c95682b908a7e4beb87dd83fb3b7.tar.bz2
mpv-8bfeecbc6ff1c95682b908a7e4beb87dd83fb3b7.tar.xz
cocoa-cb: change handling of window aspect ratio changes
i tried being smart and handle aspect ratio differences manually via atomic drawing and resizing to aspect fitted frames. there were a few issues with that. like unexpected visibility of certain System GUI elements on entering fullscreen or visually dropped frames due to the atomic drawing. now we rely on system mechanics to keep the proper aspect ratio of our layer, the recommended way. as a side effect it also fixes a segfault. Fixes #5581
Diffstat (limited to 'video/out/cocoa_cb_common.swift')
-rw-r--r--video/out/cocoa_cb_common.swift2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift
index 426181d13e..c3366ad2f7 100644
--- a/video/out/cocoa_cb_common.swift
+++ b/video/out/cocoa_cb_common.swift
@@ -57,6 +57,7 @@ class CocoaCB: NSObject {
layer = VideoLayer(cocoaCB: self)
view.layer = layer
view.wantsLayer = true
+ view.layerContentsPlacement = .scaleProportionallyToFit
}
func setMpvHandle(_ ctx: OpaquePointer) {
@@ -133,6 +134,7 @@ class CocoaCB: NSObject {
if !window.isVisible {
window.makeKeyAndOrderFront(nil)
}
+ layer.atomicDrawingStart()
window.updateSize(wr.size)
}
}