From 00b1d3d0e3f538b7819c61a147f109d7e0d8a59b Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 2 Apr 2017 20:50:33 +0200 Subject: Fix missing win32 initial size when embedded in prent window - part 2. --- plugingui/nativewindow_win32.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'plugingui/nativewindow_win32.cc') diff --git a/plugingui/nativewindow_win32.cc b/plugingui/nativewindow_win32.cc index 502bfe9..ee16fb9 100644 --- a/plugingui/nativewindow_win32.cc +++ b/plugingui/nativewindow_win32.cc @@ -55,8 +55,8 @@ LRESULT CALLBACK NativeWindowWin32::dialogProc(HWND hwnd, UINT msg, auto resizeEvent = std::make_shared(); resizeEvent->width = LOWORD(lp); resizeEvent->height = HIWORD(lp); - //native->event_queue.push_back(resizeEvent); - native->window.resized(resizeEvent->width, resizeEvent->height); + native->event_queue.push_back(resizeEvent); + //native->window.resized(resizeEvent->width, resizeEvent->height); } break; @@ -378,11 +378,10 @@ NativeWindowWin32::NativeWindowWin32(void* native_window, Window& window) RECT rect; GetClientRect(parent_window, &rect); - // Hack to make sure we scale the child and not simply the parent (again). - auto tmp = parent_window; - parent_window = nullptr; - resize(rect.right - rect.left, rect.bottom - rect.top); - parent_window = tmp; + auto resizeEvent = std::make_shared(); + resizeEvent->width = rect.right - rect.left; + resizeEvent->height = rect.bottom - rect.top; + event_queue.push_back(resizeEvent); } } -- cgit v1.2.3