diff options
author | Dudemanguy <random342@airmail.cc> | 2021-10-19 21:47:23 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-03-02 02:55:36 +0000 |
commit | c993d5c0ce79ab560e86da8d6d5fe25da35b4c78 (patch) | |
tree | f6833a88bf313984df738d1cecca875455aa2370 /video/out/wayland_common.c | |
parent | cd02b5ccf6426645796b18c0692a5c4ca1f83174 (diff) | |
download | mpv-c993d5c0ce79ab560e86da8d6d5fe25da35b4c78.tar.bz2 mpv-c993d5c0ce79ab560e86da8d6d5fe25da35b4c78.tar.xz |
player: add --auto-window-resize option
mpv's window resizing logic always automatically resized the window
whenever the video resolution changed (i.e. advancing forward in a
playlist). This simply introduces the option to make this behavior
configurable. Every windowing backend would need to implement this
behavior in their code since a reconfigure event must always be a
resize. The params of the frame changed so you either have to resize the
window to the new size of the params or make the params the same size as
the window. This commit implements it for wayland, win32, and x11.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 192231bb65..ee4ac030dd 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -2217,7 +2217,11 @@ bool vo_wayland_reconfig(struct vo *vo) wl->pending_vo_events |= VO_EVENT_DPI; } - set_geometry(wl, false); + if (wl->vo_opts->auto_window_resize || mp_rect_w(wl->geometry) == 0 || + mp_rect_h(wl->geometry) == 0) + { + set_geometry(wl, false); + } if (wl->opts->configure_bounds) set_window_bounds(wl); |