diff options
author | nyamatongwe <devnull@localhost> | 2013-04-25 10:23:32 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2013-04-25 10:23:32 +1000 |
commit | f7736f1df88d1c7fbf09de8afbcfdd2e195f58ba (patch) | |
tree | ea72f954f04f68b330558c9e988aadc1d5826bad /win32/ScintillaWin.cxx | |
parent | a88b7fb5261abd26123c79d5bc1343337e392494 (diff) | |
download | scintilla-mirror-f7736f1df88d1c7fbf09de8afbcfdd2e195f58ba.tar.gz |
Fix Direct2D drawing when returning from lock screen.
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r-- | win32/ScintillaWin.cxx | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index f8d884a98..e300253de 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -580,15 +580,19 @@ LRESULT ScintillaWin::WndPaint(uptr_t wParam) { } } else { #if defined(USE_D2D) - EnsureRenderTarget(); - AutoSurface surfaceWindow(pRenderTarget, this); - if (surfaceWindow) { - pRenderTarget->BeginDraw(); - Paint(surfaceWindow, rcPaint); - surfaceWindow->Release(); - HRESULT hr = pRenderTarget->EndDraw(); - if (hr == D2DERR_RECREATE_TARGET) { - DropRenderTarget(); + for (int attempt=0;attempt<2;attempt++) { + EnsureRenderTarget(); + AutoSurface surfaceWindow(pRenderTarget, this); + if (surfaceWindow) { + pRenderTarget->BeginDraw(); + Paint(surfaceWindow, rcPaint); + surfaceWindow->Release(); + HRESULT hr = pRenderTarget->EndDraw(); + if (hr == D2DERR_RECREATE_TARGET) { + DropRenderTarget(); + } else { + break; + } } } #endif |