summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-28 22:11:54 +0100
committerAlessandro Ghedini <alessandro@ghedini.me>2014-12-01 15:38:28 +0100
commit17f1332955449f0037ebe5fb0694c6add5971432 (patch)
tree1681c40d2f56e43743891b17f8179268fc6d400e
parentf4a1dfdffb62ef5b02589b2bd53c9bcfb358e6c3 (diff)
downloadmpv-17f1332955449f0037ebe5fb0694c6add5971432.tar.bz2
mpv-17f1332955449f0037ebe5fb0694c6add5971432.tar.xz
win32: add screen offset when handling overlarge windows
MS Windows doesn't allow windows larger than the screen, so we include a hack to make the window smaller. This hack recenters the window (what else would it do?). It didn't account for the virtual offset of the current screen, and it was reported that it forces the window to the first screen. Should fix #1292.
-rw-r--r--video/out/w32_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index f2d02d2c84..9f0180b49e 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -904,8 +904,8 @@ static int reinit_window_state(struct vo_w32_state *w32)
// Center the final window
n_w = r.right - r.left;
n_h = r.bottom - r.top;
- r.left = screen_w / 2 - n_w / 2;
- r.top = screen_h / 2 - n_h / 2;
+ r.left = w32->screenrc.x0 + screen_w / 2 - n_w / 2;
+ r.top = w32->screenrc.y0 + screen_h / 2 - n_h / 2;
r.right = r.left + n_w;
r.bottom = r.top + n_h;
}