diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-02-23 21:40:02 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-02-23 21:40:02 +0000 |
commit | 74efde9480a1b862c415dc5a9f4779a209253801 (patch) | |
tree | c7c728a5505430c5c42522660e46b8aaa5777663 /libvo/w32_common.c | |
parent | 30aa2383cadb2f879e02dca9df293c01119a3111 (diff) | |
download | mpv-74efde9480a1b862c415dc5a9f4779a209253801.tar.bz2 mpv-74efde9480a1b862c415dc5a9f4779a209253801.tar.xz |
Calculate border size in aspect keeping code by using AdjustWindowRect
instead of GetClientRect and GetWindowRect since GetClientRect returns
nonsensical values if Window is still minimized.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28713 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/w32_common.c')
-rw-r--r-- | libvo/w32_common.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libvo/w32_common.c b/libvo/w32_common.c index 160100db5b..e482536ab2 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -109,11 +109,12 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l if (vo_keepaspect && !vo_fs) { WINDOWPOS *wpos = lParam; int xborder, yborder; - RECT r2; - GetClientRect(vo_window, &r); - GetWindowRect(vo_window, &r2); - xborder = (r2.right - r2.left) - (r.right - r.left); - yborder = (r2.bottom - r2.top) - (r.bottom - r.top); + r.left = r.top = 0; + r.right = wpos->cx; + r.bottom = wpos->cy; + AdjustWindowRect(&r, GetWindowLong(vo_window, GWL_STYLE), 0); + xborder = (r.right - r.left) - wpos->cx; + yborder = (r.bottom - r.top) - wpos->cy; wpos->cx -= xborder; wpos->cy -= yborder; aspect_fit(&wpos->cx, &wpos->cy, wpos->cx, wpos->cy); wpos->cx += xborder; wpos->cy += yborder; |