summaryrefslogtreecommitdiffstats
path: root/video/out/mac/common.swift
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2023-11-27 00:36:07 +0100
committerder richter <der.richter@gmx.de>2023-12-02 14:58:01 +0100
commitaaff9edf57bd9a7911bb4da172fbde9ed393f05e (patch)
tree14661327d702196d55faf05d8f10abe152aebd30 /video/out/mac/common.swift
parent67aa5684379d42ad1e9b8cc66a04d63394e63994 (diff)
downloadmpv-aaff9edf57bd9a7911bb4da172fbde9ed393f05e.tar.bz2
mpv-aaff9edf57bd9a7911bb4da172fbde9ed393f05e.tar.xz
mac: fix initial window size and position when already maximized
in the case the window was already set to a maximized size via geometry or related options (100%x100%) the maximize function would try to maximize the window again. this reset the position and slightly increased the size further. to prevent this only maximize on init if we really want to maximize. in the reverse case make a noop call by passing the current zoom state. Fixes #11193
Diffstat (limited to 'video/out/mac/common.swift')
-rw-r--r--video/out/mac/common.swift3
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/mac/common.swift b/video/out/mac/common.swift
index 3c01abe572..226d628051 100644
--- a/video/out/mac/common.swift
+++ b/video/out/mac/common.swift
@@ -107,10 +107,11 @@ class Common: NSObject {
titleBar = TitleBar(frame: wr, window: window, common: self)
+ let maximized = Bool(mpv.opts.window_maximized)
let minimized = Bool(mpv.opts.window_minimized)
window.isRestorable = false
window.isReleasedWhenClosed = false
- window.setMaximized(minimized ? false : Bool(mpv.opts.window_maximized))
+ window.setMaximized((minimized || !maximized) ? window.isZoomed : maximized)
window.setMinimized(minimized)
window.makeMain()
window.makeKey()