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.
This commit is contained in:
wm4 2014-11-28 22:11:54 +01:00 committed by Alessandro Ghedini
parent f4a1dfdffb
commit 17f1332955
1 changed files with 2 additions and 2 deletions

View File

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