1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-30 07:18:17 +00:00

win32: fix incorrect application of --monitoraspect

The --monitoraspect value is calculated at vo_calc_window_geometry2
(VCWG2) or VCWG3, and applied via vo_apply_window_geometry.

Before this commit, the screen size which the win32 VO used with
VCWG2 was the working area (screen minus taskbar). This allows better
fitting, but breaks the pixelaspect calculation which is derived from
the --monitoraspect value and this rectangle.

VCWG3 allows an independent size for the aspect calculations, and now
we use it independently of the fit size.
This commit is contained in:
Avi Halachmi (:avih) 2021-08-12 21:14:37 +03:00 committed by avih
parent 2b1579b1c8
commit 73f16b5431

View File

@ -1422,10 +1422,13 @@ static void gui_thread_reconfig(void *ptr)
struct mp_rect screen = { r.left, r.top, r.right, r.bottom };
struct vo_win_geometry geo;
RECT monrc = get_monitor_info(w32).rcMonitor;
struct mp_rect mon = { monrc.left, monrc.top, monrc.right, monrc.bottom };
if (w32->dpi_scale == 0)
force_update_display_info(w32);
vo_calc_window_geometry2(vo, &screen, w32->dpi_scale, &geo);
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 ||