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/w32_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/w32_common.c')
-rw-r--r-- | video/out/w32_common.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 4ef57dc53d..64d69d8242 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -1438,8 +1438,9 @@ static void gui_thread_reconfig(void *ptr) vo_calc_window_geometry3(vo, &screen, &mon, w32->dpi_scale, &geo); vo_apply_window_geometry(vo, &geo); - bool reset_size = w32->o_dwidth != vo->dwidth || - w32->o_dheight != vo->dheight; + bool reset_size = (w32->o_dwidth != vo->dwidth || + w32->o_dheight != vo->dheight) && + w32->opts->auto_window_resize; w32->o_dwidth = vo->dwidth; w32->o_dheight = vo->dheight; |