diff options
author | David Robillard <d@drobilla.net> | 2019-07-21 11:36:17 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-07-21 14:44:19 +0200 |
commit | aa7fb0aad574531765bc18aeb78a034f499435d4 (patch) | |
tree | 7761b7cba7ce5cb9a2f2d8828842562c11ac0086 | |
parent | 97348233762f5973aff83b90f3383fa79afc30b8 (diff) | |
download | pugl-aa7fb0aad574531765bc18aeb78a034f499435d4.tar.gz pugl-aa7fb0aad574531765bc18aeb78a034f499435d4.tar.bz2 pugl-aa7fb0aad574531765bc18aeb78a034f499435d4.zip |
Fix initial window display on Windows
-rw-r--r-- | pugl/pugl_win.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/pugl/pugl_win.c b/pugl/pugl_win.c index 5f9d555..08b7611 100644 --- a/pugl/pugl_win.c +++ b/pugl/pugl_win.c @@ -602,7 +602,6 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) } switch (message) { - case WM_CREATE: case WM_SHOWWINDOW: case WM_SIZE: GetWindowRect(view->impl->hwnd, &rect); @@ -613,8 +612,9 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) view->height = rect.bottom - rect.top; event.configure.width = view->width; event.configure.height = view->height; - InvalidateRect(view->impl->hwnd, NULL, FALSE); + InvalidateRect(view->impl->hwnd, &rect, FALSE); UpdateWindow(view->impl->hwnd); + puglPostRedisplay(view); break; case WM_GETMINMAXINFO: mmi = (MINMAXINFO*)lParam; @@ -630,6 +630,8 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) event.expose.height = rect.bottom - rect.top; event.expose.count = 0; break; + case WM_ERASEBKGND: + return true; case WM_MOUSEMOVE: pt.x = GET_X_LPARAM(lParam); pt.y = GET_Y_LPARAM(lParam); @@ -702,8 +704,7 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) event.close.type = PUGL_CLOSE; break; default: - return DefWindowProc( - view->impl->hwnd, message, wParam, lParam); + return DefWindowProc(view->impl->hwnd, message, wParam, lParam); } puglDispatchEvent(view, &event); @@ -779,7 +780,8 @@ puglGetTime(PuglView* view) void puglPostRedisplay(PuglView* view) { - RedrawWindow(view->impl->hwnd, NULL, NULL, RDW_INVALIDATE); + RedrawWindow(view->impl->hwnd, NULL, NULL, + RDW_INVALIDATE|RDW_INTERNALPAINT); } PuglNativeWindow |