Zebediah Figura : quartz: Resize the destination rect only if we are using the default destination rect.

Alexandre Julliard julliard at winehq.org
Fri May 8 15:20:31 CDT 2020


Module: wine
Branch: master
Commit: 82420a8d3c8ea39193d1bcfc6f2ca68635a9e54d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=82420a8d3c8ea39193d1bcfc6f2ca68635a9e54d

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu May  7 20:50:23 2020 -0500

quartz: Resize the destination rect only if we are using the default destination rect.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/quartz_private.h |  3 ++-
 dlls/quartz/window.c         | 16 +++++++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h
index 33cfb5671f..5c391481f2 100644
--- a/dlls/quartz/quartz_private.h
+++ b/dlls/quartz/quartz_private.h
@@ -94,9 +94,10 @@ struct video_window
     IBasicVideo IBasicVideo_iface;
 
     RECT src, dst;
+    BOOL default_dst;
 
-    HWND hwnd;
     BOOL AutoShow;
+    HWND hwnd;
     HWND hwndDrain;
     HWND hwndOwner;
     struct strmbase_filter *pFilter;
diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c
index ada6b99ddb..efafb70daa 100644
--- a/dlls/quartz/window.c
+++ b/dlls/quartz/window.c
@@ -68,7 +68,8 @@ static LRESULT CALLBACK WndProcW(HWND hwnd, UINT message, WPARAM wparam, LPARAM
         }
         break;
     case WM_SIZE:
-        GetClientRect(window->hwnd, &window->dst);
+        if (window->default_dst)
+            GetClientRect(window->hwnd, &window->dst);
         break;
     }
 
@@ -926,6 +927,7 @@ static HRESULT WINAPI basic_video_put_DestinationLeft(IBasicVideo *iface, LONG l
 
     TRACE("window %p, left %d.\n", window, left);
 
+    window->default_dst = FALSE;
     OffsetRect(&window->dst, left - window->dst.left, 0);
     return S_OK;
 }
@@ -952,6 +954,7 @@ static HRESULT WINAPI basic_video_put_DestinationWidth(IBasicVideo *iface, LONG
     if (width <= 0)
         return E_INVALIDARG;
 
+    window->default_dst = FALSE;
     window->dst.right = window->dst.left + width;
     return S_OK;
 }
@@ -975,6 +978,7 @@ static HRESULT WINAPI basic_video_put_DestinationTop(IBasicVideo *iface, LONG to
 
     TRACE("window %p, top %d.\n", window, top);
 
+    window->default_dst = FALSE;
     OffsetRect(&window->dst, 0, top - window->dst.top);
     return S_OK;
 }
@@ -1001,6 +1005,7 @@ static HRESULT WINAPI basic_video_put_DestinationHeight(IBasicVideo *iface, LONG
     if (height <= 0)
         return E_INVALIDARG;
 
+    window->default_dst = FALSE;
     window->dst.bottom = window->dst.top + height;
     return S_OK;
 }
@@ -1073,6 +1078,7 @@ static HRESULT WINAPI basic_video_SetDestinationPosition(IBasicVideo *iface,
     if (width <= 0 || height <= 0)
         return E_INVALIDARG;
 
+    window->default_dst = FALSE;
     SetRect(&window->dst, left, top, left + width, top + height);
     return S_OK;
 }
@@ -1100,6 +1106,7 @@ static HRESULT WINAPI basic_video_SetDefaultDestinationPosition(IBasicVideo *ifa
 
     TRACE("window %p.\n", window);
 
+    window->default_dst = TRUE;
     GetClientRect(window->hwnd, &window->dst);
     return S_OK;
 }
@@ -1155,9 +1162,11 @@ static HRESULT WINAPI basic_video_IsUsingDefaultSource(IBasicVideo *iface)
 
 static HRESULT WINAPI basic_video_IsUsingDefaultDestination(IBasicVideo *iface)
 {
-    FIXME("iface %p, stub!\n", iface);
+    struct video_window *window = impl_from_IBasicVideo(iface);
 
-    return S_OK;
+    TRACE("window %p.\n", window);
+
+    return window->default_dst ? S_OK : S_FALSE;
 }
 
 static const IBasicVideoVtbl basic_video_vtbl =
@@ -1216,6 +1225,7 @@ void video_window_init(struct video_window *window, const IVideoWindowVtbl *vtbl
     window->ops = ops;
     window->IVideoWindow_iface.lpVtbl = vtbl;
     window->IBasicVideo_iface.lpVtbl = &basic_video_vtbl;
+    window->default_dst = TRUE;
     window->AutoShow = OATRUE;
     window->pFilter = owner;
     window->pPin = pin;




More information about the wine-cvs mailing list