summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2020-01-22 17:02:39 +0100
committerder richter <der.richter@gmx.de>2020-01-26 12:33:47 +0100
commit2aa4186a258d4d3829c3d072cd69b7c30f0c5eda (patch)
tree299a2ccb9648bd49b8a1f209541dc78036aebaf5 /video
parent44f6e794390314656dc8b60bed5b3be6e1adb766 (diff)
downloadmpv-2aa4186a258d4d3829c3d072cd69b7c30f0c5eda.tar.bz2
mpv-2aa4186a258d4d3829c3d072cd69b7c30f0c5eda.tar.xz
cocoa-cb: never set a window size smaller than the set minSize
this prevents a vanishing window if the size is set too small.
Diffstat (limited to 'video')
-rw-r--r--video/out/cocoa-cb/window.swift5
1 files changed, 5 insertions, 0 deletions
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 {