Skip to content

Commit 34d5d1d

Browse files
authored
[DDRAW] ddraw.c ddraw7_FlipToGDISurface() to Wine-6.8 (reactos#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 9987f02 (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
1 parent 228dab6 commit 34d5d1d

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

dll/directx/wine/ddraw/ddraw.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,15 +2093,31 @@ static HRESULT WINAPI d3d1_Initialize(IDirect3D *iface, REFIID riid)
20932093
static HRESULT WINAPI ddraw7_FlipToGDISurface(IDirectDraw7 *iface)
20942094
{
20952095
struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2096+
IDirectDrawSurface7 *gdi_surface;
2097+
struct ddraw_surface *gdi_impl;
2098+
HRESULT hr;
20962099

20972100
TRACE("iface %p.\n", iface);
20982101

2099-
ddraw->flags |= DDRAW_GDI_FLIP;
2102+
wined3d_mutex_lock();
21002103

2101-
if (ddraw->primary)
2102-
ddraw_surface_update_frontbuffer(ddraw->primary, NULL, FALSE);
2104+
if (FAILED(hr = IDirectDraw7_GetGDISurface(iface, &gdi_surface)))
2105+
{
2106+
WARN("Failed to retrieve GDI surface, hr %#x.\n", hr);
2107+
wined3d_mutex_unlock();
2108+
return hr;
2109+
}
21032110

2104-
return DD_OK;
2111+
gdi_impl = impl_from_IDirectDrawSurface7(gdi_surface);
2112+
if (gdi_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_FRONTBUFFER)
2113+
hr = DD_OK;
2114+
else
2115+
hr = IDirectDrawSurface7_Flip(&ddraw->primary->IDirectDrawSurface7_iface, gdi_surface, DDFLIP_WAIT);
2116+
IDirectDrawSurface7_Release(gdi_surface);
2117+
2118+
wined3d_mutex_unlock();
2119+
2120+
return hr;
21052121
}
21062122

21072123
static HRESULT WINAPI ddraw4_FlipToGDISurface(IDirectDraw4 *iface)

0 commit comments

Comments
 (0)