aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-07-22 23:38:37 +0200
committerDavid Robillard <d@drobilla.net>2019-07-23 20:28:56 +0200
commit8ee970143b2ad1dd4d265bca0aef18aae643d305 (patch)
treec92268a3bb48aca9c0d3b68adabcf47fdd61f9d4
parent614896f49f88f4cefd57d3cf8ce663d984d19231 (diff)
Windows: Improve live resize smoothness
-rw-r--r--pugl/pugl_win.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/pugl/pugl_win.c b/pugl/pugl_win.c
index 3f5a293..a75a259 100644
--- a/pugl/pugl_win.c
+++ b/pugl/pugl_win.c
@@ -661,15 +661,13 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
switch (message) {
case WM_SHOWWINDOW:
rect = handleConfigure(view, &event);
- InvalidateRect(view->impl->hwnd, &rect, FALSE);
- UpdateWindow(view->impl->hwnd);
puglPostRedisplay(view);
break;
case WM_SIZE:
- handleConfigure(view, &event);
- if (!view->impl->resizing) {
- puglPostRedisplay(view);
- }
+ rect = handleConfigure(view, &event);
+ RedrawWindow(view->impl->hwnd, NULL, NULL,
+ RDW_INVALIDATE|RDW_ALLCHILDREN|RDW_INTERNALPAINT|
+ RDW_UPDATENOW);
break;
case WM_ENTERSIZEMOVE:
view->impl->resizing = true;
@@ -680,7 +678,8 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_TIMER:
if (wParam == PUGL_RESIZE_TIMER_ID) {
- puglPostRedisplay(view);
+ RedrawWindow(view->impl->hwnd, NULL, NULL,
+ RDW_INVALIDATE|RDW_ALLCHILDREN|RDW_INTERNALPAINT);
} else if (wParam == PUGL_URGENT_TIMER_ID) {
FlashWindow(view->impl->hwnd, TRUE);
}
@@ -688,6 +687,7 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
case WM_EXITSIZEMOVE:
KillTimer(view->impl->hwnd, PUGL_RESIZE_TIMER_ID);
view->impl->resizing = false;
+ puglPostRedisplay(view);
break;
case WM_GETMINMAXINFO:
mmi = (MINMAXINFO*)lParam;
@@ -887,7 +887,8 @@ void
puglPostRedisplay(PuglView* view)
{
RedrawWindow(view->impl->hwnd, NULL, NULL,
- RDW_INVALIDATE|RDW_INTERNALPAINT);
+ RDW_INVALIDATE|RDW_ALLCHILDREN|RDW_INTERNALPAINT);
+ UpdateWindow(view->impl->hwnd);
}
PuglNativeWindow