From 981048e041bb96ca3028be507f3cd7f9d0a833b3 Mon Sep 17 00:00:00 2001 From: maniak1349 Date: Sat, 21 May 2016 22:33:06 +0300 Subject: 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. --- video/out/w32_common.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'video') 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", -- cgit v1.2.3