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

KO Myung-Hun komh78 at gmail.com
Sat Nov 25 11:00:53 CET 2017


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.
---
 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 b51f80d049..659272f2c7 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -108,7 +108,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;
@@ -1226,15 +1225,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,
-- 
2.13.3



More information about the vlc-devel mailing list