From 1e755094587c00feb7f9a6c7a03d1219a5c09e8a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 12 May 2023 11:29:20 -0400 Subject: Windows: Pass the struct from BeginPaint() to EndPaint() The documentation explains that the PAINTSTRUCT returned by BeginPaint() should be passed to the corresponding call to EndPaint(). I'm not sure what real-world effects not doing this had, but this commit fixes things to use the API as intended. --- src/win.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/win.c') diff --git a/src/win.c b/src/win.c index 08eebec..75e0d71 100644 --- a/src/win.c +++ b/src/win.c @@ -1651,8 +1651,7 @@ PuglStatus puglWinEnter(PuglView* view, const PuglExposeEvent* expose) { if (expose) { - PAINTSTRUCT ps; - BeginPaint(view->impl->hwnd, &ps); + BeginPaint(view->impl->hwnd, &view->impl->paint); } return PUGL_SUCCESS; @@ -1662,8 +1661,7 @@ PuglStatus puglWinLeave(PuglView* view, const PuglExposeEvent* expose) { if (expose) { - PAINTSTRUCT ps; - EndPaint(view->impl->hwnd, &ps); + EndPaint(view->impl->hwnd, &view->impl->paint); } return PUGL_SUCCESS; -- cgit v1.2.1