[deploy] fix: missing WindowResizedEvent when maximized

This commit is contained in:
Nomango 2020-10-16 00:17:58 +08:00
parent 266453a907
commit 18a0fd5e55
1 changed files with 19 additions and 10 deletions

View File

@ -603,6 +603,7 @@ LRESULT WindowWin32Impl::MessageProc(HWND hwnd, UINT32 msg, WPARAM wparam, LPARA
case WM_SIZE: case WM_SIZE:
{ {
bool resized = false;
if (SIZE_MAXHIDE == wparam || SIZE_MINIMIZED == wparam) if (SIZE_MAXHIDE == wparam || SIZE_MINIMIZED == wparam)
{ {
KGE_DEBUG_LOGF("Window minimized"); KGE_DEBUG_LOGF("Window minimized");
@ -620,6 +621,10 @@ LRESULT WindowWin32Impl::MessageProc(HWND hwnd, UINT32 msg, WPARAM wparam, LPARA
is_minimized_ = false; is_minimized_ = false;
Application::GetInstance().Resume(); Application::GetInstance().Resume();
} }
else
{
resized = true;
}
} }
else if (wparam == SIZE_RESTORED) else if (wparam == SIZE_RESTORED)
{ {
@ -636,6 +641,11 @@ LRESULT WindowWin32Impl::MessageProc(HWND hwnd, UINT32 msg, WPARAM wparam, LPARA
// DO NOTHING until the dragging / resizing has stopped. // DO NOTHING until the dragging / resizing has stopped.
} }
else else
{
resized = true;
}
}
if (resized)
{ {
this->width_ = ((uint32_t)(short)LOWORD(lparam)); this->width_ = ((uint32_t)(short)LOWORD(lparam));
this->height_ = ((uint32_t)(short)HIWORD(lparam)); this->height_ = ((uint32_t)(short)HIWORD(lparam));
@ -649,7 +659,6 @@ LRESULT WindowWin32Impl::MessageProc(HWND hwnd, UINT32 msg, WPARAM wparam, LPARA
KGE_DEBUG_LOGF("Window resized to (%d, %d)", this->width_, this->height_); KGE_DEBUG_LOGF("Window resized to (%d, %d)", this->width_, this->height_);
} }
} }
}
break; break;
case WM_ENTERSIZEMOVE: case WM_ENTERSIZEMOVE: