diff options
Diffstat (limited to 'libvo/w32_common.c')
-rw-r--r-- | libvo/w32_common.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libvo/w32_common.c b/libvo/w32_common.c index c7f835c64f..ab1c245055 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -61,6 +61,18 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l vo_dheight = r.bottom; break; case WM_WINDOWPOSCHANGING: + 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); + wpos->cx -= xborder; wpos->cy -= yborder; + aspect_fit(&wpos->cx, &wpos->cy, wpos->cx, wpos->cy); + wpos->cx += xborder; wpos->cy += yborder; + } return 0; case WM_CLOSE: mplayer_put_key(KEY_CLOSE_WIN); |