Browse Source
Merge pull request #4870 from MarchingCube/fix-non-dwm-paint-handler-cycle
Revert change to win32 paint handler that was causing infinite repaints
pull/4873/head
danwalmsley
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
11 additions and
6 deletions
-
src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs
|
|
|
@ -343,16 +343,21 @@ namespace Avalonia.Win32 |
|
|
|
|
|
|
|
case WindowsMessage.WM_PAINT: |
|
|
|
{ |
|
|
|
using (_rendererLock.Lock()) |
|
|
|
using (_rendererLock.Lock()) |
|
|
|
{ |
|
|
|
if (BeginPaint(_hwnd, out PAINTSTRUCT ps) != IntPtr.Zero) |
|
|
|
{ |
|
|
|
Paint?.Invoke(default); |
|
|
|
var f = RenderScaling; |
|
|
|
var r = ps.rcPaint; |
|
|
|
Paint?.Invoke(new Rect(r.left / f, r.top / f, (r.right - r.left) / f, |
|
|
|
(r.bottom - r.top) / f)); |
|
|
|
EndPaint(_hwnd, ref ps); |
|
|
|
} |
|
|
|
|
|
|
|
ValidateRect(hWnd, IntPtr.Zero); |
|
|
|
|
|
|
|
return IntPtr.Zero; |
|
|
|
} |
|
|
|
|
|
|
|
return IntPtr.Zero; |
|
|
|
} |
|
|
|
|
|
|
|
case WindowsMessage.WM_SIZE: |
|
|
|
{ |
|
|
|
using (_rendererLock.Lock()) |
|
|
|
|