diff options
| author | Bent Bisballe Nyeng <deva@aasimon.org> | 2019-10-06 20:22:08 +0200 | 
|---|---|---|
| committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2019-10-06 20:22:08 +0200 | 
| commit | 9b7299412d10e68c8aacc5f0debb7c80bf874120 (patch) | |
| tree | 93ad61320d838bf29b3c3edc73d05065bf3a6a63 /plugingui | |
| parent | 1ada99b405a8a91524cabbdcdd07466079c89c4a (diff) | |
Fix GUI not showing in Reaper under Windows on first opening it.
Diffstat (limited to 'plugingui')
| -rw-r--r-- | plugingui/nativewindow_win32.cc | 23 | 
1 files changed, 15 insertions, 8 deletions
| 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>();  			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;  	} | 
