From 5a3c299ca1afcaf943576a144aad92716deb5cf9 Mon Sep 17 00:00:00 2001 From: maniak1349 Date: Sat, 21 May 2016 22:43:25 +0300 Subject: w32_common: make VOCTRL_SET_UNFS_WINDOW_SIZE resize the window around its center Before that position of the window top-left corner was remaining the same when the window was scaled. Right now VOCTRL_SET_UNFS_WINDOW_SIZE is called only by window-scale. This change will not affect resizes made by the user (dragging window edge). Fixes #3164. --- video/out/w32_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 56d0e2ed6b..df67dc32b3 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -1403,9 +1403,13 @@ static int gui_thread_control(struct vo_w32_state *w32, int request, void *arg) if (!w32->window_bounds_initialized) return VO_FALSE; if (w32->current_fs) { + w32->prev_x += w32->prev_width / 2 - s[0] / 2; + w32->prev_y += w32->prev_height / 2 - s[1] / 2; w32->prev_width = s[0]; w32->prev_height = s[1]; } else { + w32->window_x += w32->dw / 2 - s[0] / 2; + w32->window_y += w32->dh / 2 - s[1] / 2; w32->dw = s[0]; w32->dh = s[1]; } -- cgit v1.2.3