changeset 28678:c48f4a1835da

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.
author reimar
date Mon, 23 Feb 2009 21:40:02 +0000
parents cd9aa9b2533a
children f8d1b475d90d
files libvo/w32_common.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/w32_common.c	Mon Feb 23 11:48:45 2009 +0000
+++ b/libvo/w32_common.c	Mon Feb 23 21:40:02 2009 +0000
@@ -109,11 +109,12 @@
             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;