summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2023-12-19 20:55:04 +0100
committerder richter <der.richter@gmx.de>2023-12-23 01:15:53 +0100
commit0d47e484374c7cb78d5974199a36f91eded68c8f (patch)
tree56584284075188b7d43187f4b46b3482aa71f37b
parentfa4ca16f6601eb51d64ae61bb5d4c018387cbadd (diff)
downloadmpv-0d47e484374c7cb78d5974199a36f91eded68c8f.tar.bz2
mpv-0d47e484374c7cb78d5974199a36f91eded68c8f.tar.xz
mac: add support for --auto-window-resize option
Fixes #9325
-rw-r--r--DOCS/man/options.rst1
-rw-r--r--video/out/cocoa_cb_common.swift2
-rw-r--r--video/out/mac_common.swift4
3 files changed, 4 insertions, 3 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index 61d251a067..23c4884607 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -3400,7 +3400,6 @@ Window
be the default behavior. Currently only affects X11 and SDL VOs.
``--auto-window-resize=<yes|no>``
- (Wayland, Win32, and X11)
By default, mpv will automatically resize itself if the video's size changes
(i.e. advancing forward in a playlist). Setting this to ``no`` disables this
behavior so the window size never changes automatically. This option does
diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift
index 9c0054a9d7..4655cabf9b 100644
--- a/video/out/cocoa_cb_common.swift
+++ b/video/out/cocoa_cb_common.swift
@@ -64,7 +64,7 @@ class CocoaCB: Common {
mpv?.vo = vo
if backendState == .needsInit {
DispatchQueue.main.sync { self.initBackend(vo) }
- } else {
+ } else if mpv?.opts.auto_window_resize ?? true {
DispatchQueue.main.async {
self.updateWindowSize(vo)
self.layer?.update(force: true)
diff --git a/video/out/mac_common.swift b/video/out/mac_common.swift
index 349712bf39..dd8d80ceea 100644
--- a/video/out/mac_common.swift
+++ b/video/out/mac_common.swift
@@ -58,7 +58,9 @@ class MacCommon: Common {
initWindowState()
}
- if !NSEqualSizes(window?.unfsContentFramePixel.size ?? NSZeroSize, wr.size) {
+ if !NSEqualSizes(window?.unfsContentFramePixel.size ?? NSZeroSize, wr.size) &&
+ mpv?.opts.auto_window_resize ?? true
+ {
window?.updateSize(wr.size)
}