From 9b7299412d10e68c8aacc5f0debb7c80bf874120 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 6 Oct 2019 20:22:08 +0200 Subject: Fix GUI not showing in Reaper under Windows on first opening it. --- plugingui/nativewindow_win32.cc | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'plugingui') diff --git a/plugingui/nativewindow_win32.cc b/plugingui/nativewindow_win32.cc index 1ac1115..55f7c69 100644 --- a/plugingui/nativewindow_win32.cc +++ b/plugingui/nativewindow_win32.cc @@ -59,8 +59,14 @@ LRESULT CALLBACK NativeWindowWin32::dialogProc(HWND hwnd, UINT msg, Window& window = native->window; - switch(msg) { + switch(msg) + { case WM_SIZE: + if(wp > 4) + { + // Bogus value - ignore + break; + } { auto resizeEvent = std::make_shared(); resizeEvent->width = LOWORD(lp); @@ -344,18 +350,19 @@ LRESULT CALLBACK NativeWindowWin32::subClassProc(HWND hwnd, UINT msg, return DefWindowProc(hwnd, msg, wp, lp); } - switch(msg) { + switch(msg) + { case WM_SIZE: + if(wp > 4) { + // Bogus value - ignore + break; + } + { + // Parent window size changed, replicate this size in inner window. int width = LOWORD(lp); int height = HIWORD(lp); SetWindowPos(native->m_hwnd, nullptr, -1, -1, width, height, SWP_NOMOVE); - RECT rect; - GetClientRect(native->m_hwnd, &rect); - 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; } -- cgit v1.2.3