cocoa-cb: never set a window size smaller than the set minSize

this prevents a vanishing window if the size is set too small.
This commit is contained in:
der richter 2020-01-22 17:02:39 +01:00
parent 44f6e79439
commit 2aa4186a25
1 changed files with 5 additions and 0 deletions

View File

@ -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 {