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.
This commit is contained in:
maniak1349 2016-05-21 22:43:25 +03:00 committed by wm4
parent 364af7c630
commit 5a3c299ca1
1 changed files with 4 additions and 0 deletions

View File

@ -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];
}