mirror of
https://github.com/mpv-player/mpv
synced 2025-01-06 23:20:15 +00:00
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
This commit is contained in:
parent
67aa568437
commit
aaff9edf57
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user