From 2aa4186a258d4d3829c3d072cd69b7c30f0c5eda Mon Sep 17 00:00:00 2001 From: der richter Date: Wed, 22 Jan 2020 17:02:39 +0100 Subject: cocoa-cb: never set a window size smaller than the set minSize this prevents a vanishing window if the size is set too small. --- video/out/cocoa-cb/window.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/video/out/cocoa-cb/window.swift b/video/out/cocoa-cb/window.swift index 9e2c6e3122..03ea17da57 100644 --- a/video/out/cocoa-cb/window.swift +++ b/video/out/cocoa-cb/window.swift @@ -317,6 +317,11 @@ class Window: NSWindow, NSWindowDelegate { } override func setFrame(_ frameRect: NSRect, display flag: Bool) { + if frameRect.width < minSize.width || frameRect.height < minSize.height { + mpv?.sendVerbose("tried to set too small window size: \(frameRect.size)") + return + } + super.setFrame(frameRect, display: flag) if let size = unfsContentFrame?.size, keepAspect { -- cgit v1.2.3