summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2021-08-12 21:14:37 +0300
committeravih <avih@users.noreply.github.com>2021-09-06 10:16:10 +0300
commit73f16b54316cf3bcb7bfd12501ee5f38c2146d58 (patch)
treebd2a8e07c2d5869c228d77908461beb392c9f59c
parent2b1579b1c81500ffd0e49954bb380b7016ff33c3 (diff)
downloadmpv-73f16b54316cf3bcb7bfd12501ee5f38c2146d58.tar.bz2
mpv-73f16b54316cf3bcb7bfd12501ee5f38c2146d58.tar.xz
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.
-rw-r--r--video/out/w32_common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index 7308371125..8c06d5b325 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -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 ||