mirror of
https://github.com/mpv-player/mpv
synced 2025-04-01 23:00:41 +00:00
cocoa-cb: support maximize/minimize on startup
Allow the --window-maximized and --window-minimized flags to actually work when the player is started. since macOS doesn't like using both at the same time the minimized state takes precedence over the maximized state.
This commit is contained in:
parent
c784820454
commit
cd22e93fee
@ -128,10 +128,18 @@ class CocoaCB: NSObject {
|
||||
|
||||
titleBar = TitleBar(frame: wr, window: window, cocoaCB: self)
|
||||
|
||||
let minimized = Bool(opts.window_minimized)
|
||||
window.isRestorable = false
|
||||
window.isReleasedWhenClosed = false
|
||||
window.setMaximized(minimized ? false : Bool(opts.window_maximized))
|
||||
window.setMinimized(minimized)
|
||||
window.makeMain()
|
||||
window.makeKeyAndOrderFront(nil)
|
||||
window.makeKey()
|
||||
|
||||
if !minimized {
|
||||
window.orderFront(nil)
|
||||
}
|
||||
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
|
||||
if Bool(opts.fullscreen) {
|
||||
|
Loading…
Reference in New Issue
Block a user