Skip to content

Commit

Permalink
mac: add support for --force-window-position
Browse files Browse the repository at this point in the history
  • Loading branch information
NekoAsakura authored and Akemi committed Dec 31, 2024
1 parent 1551cef commit 50042f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DOCS/man/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3569,7 +3569,7 @@ Window
``--force-window-position``
Forcefully move mpv's video output window to default location whenever
there is a change in video parameters, video stream or file. This used to
be the default behavior. Currently only affects X11 and SDL VOs.
be the default behavior. Currently only affects X11, macvk and SDL VOs.

``--auto-window-resize=<yes|no>``
By default, mpv will automatically resize itself if the video's size changes
Expand Down
7 changes: 4 additions & 3 deletions video/out/mac_common.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ class MacCommon: Common {
let previousActiveApp = getActiveApp()
initApp()

let (_, wr, _) = getInitProperties(vo)

let (_, wr, forcePosition) = getInitProperties(vo)
guard let layer = self.layer else {
log.error("Something went wrong, no MetalLayer was initialized")
exit(1)
Expand All @@ -60,7 +59,9 @@ class MacCommon: Common {
initWindowState()
}

if option.vo.auto_window_resize {
if forcePosition {
window?.updateFrame(wr)
} else if option.vo.auto_window_resize {
window?.updateSize(wr.size)
}

Expand Down

0 comments on commit 50042f5

Please sign in to comment.