[vlc-commits] kva: improve resizing of the embedded video window

KO Myung-Hun git at videolan.org
Mon Nov 27 10:08:42 CET 2017


vlc | branch: master | KO Myung-Hun <komh78 at gmail.com> | Sat Nov 25 19:00:53 2017 +0900| [fc87adcd2ec86a1c15cd59ddb82527b082e2106f] | committer: Jean-Baptiste Kempf

kva: improve resizing of the embedded video window

Sometimes the embedded video window is not resized properly. This
occurs due to mismatch of the cached video window size and the real
video window size. To avoid this, compare the parent window size with
the video window size directly.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fc87adcd2ec86a1c15cd59ddb82527b082e2106f
---

 modules/video_output/kva.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
index dbd2a737ed..15acb1a5fb 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -99,7 +99,6 @@ struct vout_display_sys_t
     RECTL              client_rect;
     vout_window_t     *parent_window;
     HWND               parent;
-    RECTL              parent_rect;
     picture_pool_t    *pool;
     unsigned           button_pressed;
     bool               is_mouse_hidden;
@@ -1146,15 +1145,16 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
      * parent window size */
     if( sys->parent_window )
     {
+        RECTL rect;
+
         WinQueryWindowRect( sys->parent, &rcl );
+        WinQueryWindowRect( sys->client, &rect);
 
-        if( rcl.xLeft   != sys->parent_rect.xLeft   ||
-            rcl.yBottom != sys->parent_rect.yBottom ||
-            rcl.xRight  != sys->parent_rect.xRight  ||
-            rcl.yTop    != sys->parent_rect.yTop)
+        if( rcl.xLeft   != rect.xLeft   ||
+            rcl.yBottom != rect.yBottom ||
+            rcl.xRight  != rect.xRight  ||
+            rcl.yTop    != rect.yTop)
         {
-            sys->parent_rect = rcl;
-
             WinCalcFrameRect( sys->frame, &rcl, FALSE );
 
             WinSetWindowPos( sys->frame, NULLHANDLE,



More information about the vlc-commits mailing list