diff options
author | maniak1349 <maniak1349@gmail.com> | 2016-05-21 22:43:25 +0300 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-05-22 14:31:37 +0200 |
commit | 5a3c299ca1afcaf943576a144aad92716deb5cf9 (patch) | |
tree | dff07e0eae6c6a7028e2ffca040cec20ec2fdd68 /video/out | |
parent | 364af7c6307770e48db89ad11a21724e78634e9f (diff) | |
download | mpv-5a3c299ca1afcaf943576a144aad92716deb5cf9.tar.bz2 mpv-5a3c299ca1afcaf943576a144aad92716deb5cf9.tar.xz |
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.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/w32_common.c | 4 |
1 files changed, 4 insertions, 0 deletions
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]; } |