summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authormaniak1349 <maniak1349@gmail.com>2016-05-21 22:33:06 +0300
committerwm4 <wm4@nowhere>2016-05-22 14:31:37 +0200
commit981048e041bb96ca3028be507f3cd7f9d0a833b3 (patch)
treebe2d429dbc0c7146600c1562fc89a09bd4c4f508 /video
parent035297212a22f219cdc7bcf4341a154fd2516c28 (diff)
downloadmpv-981048e041bb96ca3028be507f3cd7f9d0a833b3.tar.bz2
mpv-981048e041bb96ca3028be507f3cd7f9d0a833b3.tar.xz
w32_common: update stored client area size on window resize
Properly update stored client area size when the window is resized in reinit_window_state due to window size exceeding the size of the screen. This was causing wrong behavior with window-scale - when window size was becoming too big the window was resized but the video was not.
Diffstat (limited to 'video')
-rw-r--r--video/out/w32_common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index 28b7a7a14b..e3b1914494 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -1100,8 +1100,15 @@ static void reinit_window_state(struct vo_w32_state *w32)
} else {
n_w = n_h * asp;
}
+ // Save new size
+ w32->dw = n_w;
+ w32->dh = n_h;
+ // Add window borders to the new window size
r = (RECT){.right = n_w, .bottom = n_h};
add_window_borders(w32->window, &r);
+ // Get top and left border size for client area position calculation
+ long b_top = -r.top;
+ long b_left = -r.left;
// Center the final window
n_w = r.right - r.left;
n_h = r.bottom - r.top;
@@ -1109,6 +1116,9 @@ static void reinit_window_state(struct vo_w32_state *w32)
r.top = w32->screenrc.y0 + screen_h / 2 - n_h / 2;
r.right = r.left + n_w;
r.bottom = r.top + n_h;
+ // Save new client area position
+ w32->window_x = r.left + b_left;
+ w32->window_y = r.top + b_top;
}
MP_VERBOSE(w32, "reset window bounds: %d:%d:%d:%d\n",