From 8bfeecbc6ff1c95682b908a7e4beb87dd83fb3b7 Mon Sep 17 00:00:00 2001 From: Akemi Date: Mon, 5 Mar 2018 02:11:25 +0100 Subject: 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 --- video/out/cocoa_cb_common.swift | 2 ++ 1 file changed, 2 insertions(+) (limited to 'video/out/cocoa_cb_common.swift') 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) } } -- cgit v1.2.3