mac: add support for --auto-window-resize option

Fixes #9325
This commit is contained in:
der richter 2023-12-19 20:55:04 +01:00
parent fa4ca16f66
commit 0d47e48437
3 changed files with 4 additions and 3 deletions

View File

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

View File

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

View File

@ -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)
}