diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2017-04-09 11:13:39 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2017-04-11 21:38:40 +0200 |
commit | 50f7827f48cd8b16415667d040486d40bf6778cb (patch) | |
tree | 907fbb79dd8c03e4b0c986c85487a7c073eb0fca /plugingui/nativewindow_win32.cc | |
parent | 8060a2de98c31ed8bf76cb2db1e8983ef38488bb (diff) |
Fix missing redraw after initialisation on Win32.
Diffstat (limited to 'plugingui/nativewindow_win32.cc')
-rw-r--r-- | plugingui/nativewindow_win32.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugingui/nativewindow_win32.cc b/plugingui/nativewindow_win32.cc index d897c25..c166d04 100644 --- a/plugingui/nativewindow_win32.cc +++ b/plugingui/nativewindow_win32.cc @@ -56,7 +56,6 @@ LRESULT CALLBACK NativeWindowWin32::dialogProc(HWND hwnd, UINT msg, resizeEvent->width = LOWORD(lp); resizeEvent->height = HIWORD(lp); native->event_queue.push_back(resizeEvent); - //native->window.resized(resizeEvent->width, resizeEvent->height); } break; @@ -227,6 +226,12 @@ LRESULT CALLBACK NativeWindowWin32::dialogProc(HWND hwnd, UINT msg, RECT rect; GetUpdateRect(hwnd, &rect, FALSE); + // Bypass partial update, which is apparrently broken. + rect.left = 0; + rect.top = 0; + rect.right = window.wpixbuf.width; + rect.bottom = window.wpixbuf.height; + auto repaintEvent = std::make_shared<RepaintEvent>(); repaintEvent->x = rect.left; repaintEvent->y = rect.top; @@ -320,6 +325,7 @@ LRESULT CALLBACK NativeWindowWin32::subClassProc(HWND hwnd, UINT msg, int w = width - rect.right; int h = height - rect.bottom; SetWindowPos(native->m_hwnd, nullptr, -1, -1, width + w, height + h, SWP_NOMOVE); + native->window.resized(w, h); } break; } @@ -381,8 +387,7 @@ NativeWindowWin32::NativeWindowWin32(void* native_window, Window& window) auto resizeEvent = std::make_shared<ResizeEvent>(); resizeEvent->width = rect.right - rect.left; resizeEvent->height = rect.bottom - rect.top; - //event_queue.push_back(resizeEvent); - window.resized(resizeEvent->width, resizeEvent->height); + event_queue.push_back(resizeEvent); } } |