[MPlayer-cvslog] r28713 - trunk/libvo/w32_common.c

reimar subversion at mplayerhq.hu
Mon Feb 23 22:40:03 CET 2009


Author: reimar
Date: Mon Feb 23 22:40:02 2009
New Revision: 28713

Log:
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.

Modified:
   trunk/libvo/w32_common.c

Modified: trunk/libvo/w32_common.c
==============================================================================
--- trunk/libvo/w32_common.c	Mon Feb 23 12:48:45 2009	(r28712)
+++ trunk/libvo/w32_common.c	Mon Feb 23 22:40:02 2009	(r28713)
@@ -109,11 +109,12 @@ static LRESULT CALLBACK WndProc(HWND hWn
             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;



More information about the MPlayer-cvslog mailing list