mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Fixed issue with GDI controls not always being visible
Reverted an earlier optimization that tried to handle WM_ERASEBKGND and WM_PAINT events in a single update cycle for reduced flickering. It caused some child controls to not display properly. Fixes an issue reported in #15.
This commit is contained in:
parent
d2adc5c811
commit
c63d36d831
@ -156,36 +156,24 @@ namespace
|
|||||||
|
|
||||||
LRESULT onEraseBackground(HWND hwnd, HDC dc, WNDPROC origWndProc)
|
LRESULT onEraseBackground(HWND hwnd, HDC dc, WNDPROC origWndProc)
|
||||||
{
|
{
|
||||||
if (!hwnd || !Gdi::beginGdiRendering())
|
if (hwnd && Gdi::beginGdiRendering())
|
||||||
{
|
{
|
||||||
return CallWindowProc(origWndProc, hwnd, WM_ERASEBKGND, reinterpret_cast<WPARAM>(dc), 0);
|
LRESULT result = 0;
|
||||||
}
|
HDC compatDc = Gdi::Dc::getDc(dc);
|
||||||
|
if (compatDc)
|
||||||
LRESULT result = 0;
|
|
||||||
HDC compatDc = Gdi::Dc::getDc(dc);
|
|
||||||
if (compatDc)
|
|
||||||
{
|
|
||||||
result = CallWindowProc(origWndProc, hwnd, WM_ERASEBKGND, reinterpret_cast<WPARAM>(compatDc), 0);
|
|
||||||
Gdi::Dc::releaseDc(dc);
|
|
||||||
if (result)
|
|
||||||
{
|
{
|
||||||
DDraw::RealPrimarySurface::disableUpdates();
|
result = CallWindowProc(origWndProc, hwnd, WM_ERASEBKGND, reinterpret_cast<WPARAM>(compatDc), 0);
|
||||||
|
Gdi::Dc::releaseDc(dc);
|
||||||
|
}
|
||||||
|
|
||||||
|
Gdi::endGdiRendering();
|
||||||
|
if (compatDc)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
result = CallWindowProc(origWndProc, hwnd, WM_ERASEBKGND, reinterpret_cast<WPARAM>(dc), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Gdi::endGdiRendering();
|
return CallWindowProc(origWndProc, hwnd, WM_ERASEBKGND, reinterpret_cast<WPARAM>(dc), 0);
|
||||||
|
|
||||||
if (result && compatDc)
|
|
||||||
{
|
|
||||||
UpdateWindow(hwnd);
|
|
||||||
DDraw::RealPrimarySurface::enableUpdates();
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT onMenuPaint(HWND hwnd, WNDPROC origWndProc)
|
LRESULT onMenuPaint(HWND hwnd, WNDPROC origWndProc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user