diff options
author | David Robillard <d@drobilla.net> | 2023-05-12 11:29:20 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-05-12 11:30:17 -0400 |
commit | 1e755094587c00feb7f9a6c7a03d1219a5c09e8a (patch) | |
tree | c3f3429c309d1a7bf57a7d272406f9b6c0ef98a7 /src/win_cairo.c | |
parent | d7a71b45ddf2a1ccfb124b84305b67e01919a206 (diff) | |
download | pugl-1e755094587c00feb7f9a6c7a03d1219a5c09e8a.tar.gz pugl-1e755094587c00feb7f9a6c7a03d1219a5c09e8a.tar.bz2 pugl-1e755094587c00feb7f9a6c7a03d1219a5c09e8a.zip |
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.
Diffstat (limited to 'src/win_cairo.c')
-rw-r--r-- | src/win_cairo.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/win_cairo.c b/src/win_cairo.c index 4bef2e6..10e06e6 100644 --- a/src/win_cairo.c +++ b/src/win_cairo.c @@ -108,8 +108,7 @@ puglWinCairoEnter(PuglView* view, const PuglExposeEvent* expose) if (expose && !(st = puglWinCairoCreateDrawContext(view)) && !(st = puglWinCairoOpen(view))) { - PAINTSTRUCT ps; - BeginPaint(view->impl->hwnd, &ps); + BeginPaint(view->impl->hwnd, &view->impl->paint); } return st; @@ -136,8 +135,7 @@ puglWinCairoLeave(PuglView* view, const PuglExposeEvent* expose) puglWinCairoClose(view); puglWinCairoDestroyDrawContext(view); - PAINTSTRUCT ps; - EndPaint(view->impl->hwnd, &ps); + EndPaint(view->impl->hwnd, &view->impl->paint); } return PUGL_SUCCESS; |