[DDRAW] ddraw.c ddraw7_FlipToGDISurface() to Wine-6.8 (#3827) CORE-15128

fixes CORE-15128 "Fall 0.1.3, black controls all over the desktop after exiting the game"
which regressed by 0.4.9-dev-155-g 9987f02917
(the sync to Wine Staging 3.3)

the patch on top of 0.4.15-dev-2923-g2210d23:
KVM: https://reactos.org/testman/compare.php?ids=78290,78295 LGTM
VBox: https://reactos.org/testman/compare.php?ids=78291,78294 LGTM
This commit is contained in:
Doug Lyons 2021-07-15 12:04:46 -05:00 committed by GitHub
parent 228dab60da
commit 34d5d1dbd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2093,15 +2093,31 @@ static HRESULT WINAPI d3d1_Initialize(IDirect3D *iface, REFIID riid)
static HRESULT WINAPI ddraw7_FlipToGDISurface(IDirectDraw7 *iface)
{
struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
IDirectDrawSurface7 *gdi_surface;
struct ddraw_surface *gdi_impl;
HRESULT hr;
TRACE("iface %p.\n", iface);
ddraw->flags |= DDRAW_GDI_FLIP;
wined3d_mutex_lock();
if (ddraw->primary)
ddraw_surface_update_frontbuffer(ddraw->primary, NULL, FALSE);
if (FAILED(hr = IDirectDraw7_GetGDISurface(iface, &gdi_surface)))
{
WARN("Failed to retrieve GDI surface, hr %#x.\n", hr);
wined3d_mutex_unlock();
return hr;
}
return DD_OK;
gdi_impl = impl_from_IDirectDrawSurface7(gdi_surface);
if (gdi_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_FRONTBUFFER)
hr = DD_OK;
else
hr = IDirectDrawSurface7_Flip(&ddraw->primary->IDirectDrawSurface7_iface, gdi_surface, DDFLIP_WAIT);
IDirectDrawSurface7_Release(gdi_surface);
wined3d_mutex_unlock();
return hr;
}
static HRESULT WINAPI ddraw4_FlipToGDISurface(IDirectDraw4 *iface)