From c993d5c0ce79ab560e86da8d6d5fe25da35b4c78 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Tue, 19 Oct 2021 21:47:23 -0500 Subject: 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. --- options/options.c | 2 ++ options/options.h | 1 + 2 files changed, 3 insertions(+) (limited to 'options') diff --git a/options/options.c b/options/options.c index 2beb5d01b8..1e49731709 100644 --- a/options/options.c +++ b/options/options.c @@ -118,6 +118,7 @@ static const m_option_t mp_vo_opt_list[] = { {"autofit", OPT_SIZE_BOX(autofit)}, {"autofit-larger", OPT_SIZE_BOX(autofit_larger)}, {"autofit-smaller", OPT_SIZE_BOX(autofit_smaller)}, + {"auto-window-resize", OPT_BOOL(auto_window_resize)}, {"window-scale", OPT_DOUBLE(window_scale), M_RANGE(0.001, 100)}, {"window-minimized", OPT_BOOL(window_minimized)}, {"window-maximized", OPT_BOOL(window_maximized)}, @@ -201,6 +202,7 @@ const struct m_sub_options vo_sub_opts = { .panscan = 0.0f, .scale_x = 1.0f, .scale_y = 1.0f, + .auto_window_resize = true, .keepaspect = true, .keepaspect_window = true, .hidpi_window_scale = true, diff --git a/options/options.h b/options/options.h index 2830a7a14d..a44a8253a3 100644 --- a/options/options.h +++ b/options/options.h @@ -48,6 +48,7 @@ typedef struct mp_vo_opts { struct m_geometry autofit_smaller; double window_scale; + bool auto_window_resize; bool keepaspect; bool keepaspect_window; bool hidpi_window_scale; -- cgit v1.2.3