aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/win.c
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/detail/win.c')
-rw-r--r--pugl/detail/win.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/pugl/detail/win.c b/pugl/detail/win.c
index edc8447..1203bca 100644
--- a/pugl/detail/win.c
+++ b/pugl/detail/win.c
@@ -511,7 +511,8 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
switch (message) {
case WM_SHOWWINDOW:
rect = handleConfigure(view, &event);
- puglPostRedisplay(view);
+ RedrawWindow(view->impl->hwnd, NULL, NULL,
+ RDW_INVALIDATE|RDW_ALLCHILDREN|RDW_INTERNALPAINT);
break;
case WM_SIZE:
rect = handleConfigure(view, &event);
@@ -688,8 +689,15 @@ puglWaitForEvent(PuglView* PUGL_UNUSED(view))
}
PUGL_API PuglStatus
-puglDispatchEvents(PuglWorld* PUGL_UNUSED(world))
+puglDispatchEvents(PuglWorld* world)
{
+ for (size_t i = 0; i < world->numViews; ++i) {
+ if (world->views[i]->redisplay) {
+ UpdateWindow(world->views[i]->impl->hwnd);
+ world->views[i]->redisplay = false;
+ }
+ }
+
/* Windows has no facility to process only currently queued messages, which
causes the event loop to run forever in cases like mouse movement where
the queue is constantly being filled with new messages. To work around
@@ -756,9 +764,8 @@ puglGetTime(const PuglWorld* world)
void
puglPostRedisplay(PuglView* view)
{
- RedrawWindow(view->impl->hwnd, NULL, NULL,
- RDW_INVALIDATE|RDW_ALLCHILDREN|RDW_INTERNALPAINT);
- UpdateWindow(view->impl->hwnd);
+ InvalidateRect(view->impl->hwnd, NULL, false);
+ view->redisplay = true;
}
PuglNativeWindow