From 649ba3050a67b35b5599c6d24a7036140617b30c Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Mon, 2 Sep 2024 14:49:11 +0200 Subject: [PATCH] make sure we always got a cliplist --- src/ddclipper.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ddclipper.c b/src/ddclipper.c index eeec712..d1d6ceb 100644 --- a/src/ddclipper.c +++ b/src/ddclipper.c @@ -3,6 +3,7 @@ #include "IDirectDrawClipper.h" #include "ddclipper.h" #include "debug.h" +#include "dd.h" HRESULT ddc_GetClipList(IDirectDrawClipperImpl* This, LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSiz) @@ -168,6 +169,12 @@ HRESULT ddc_SetHWnd(IDirectDrawClipperImpl* This, DWORD dwFlags, HWND hWnd) */ This->hwnd = hWnd; + if (hWnd && !This->region && g_ddraw.width) + { + RECT rc = { 0, 0, g_ddraw.width, g_ddraw.height }; + ddc_SetClipRect(This, &rc); + } + LeaveCriticalSection(&This->cs); return DD_OK; }