This commit is contained in:
Branimir Karadžić
2016-11-14 21:46:59 -08:00
parent ea5abbef2f
commit a96372cd69
3 changed files with 300 additions and 229 deletions

View File

@@ -560,10 +560,15 @@ namespace entry
case WM_USER_WINDOW_DESTROY:
{
WindowHandle handle = { (uint16_t)_wparam };
PostMessageA(m_hwnd[_wparam], WM_CLOSE, 0, 0);
m_eventQueue.postWindowEvent(handle);
DestroyWindow(m_hwnd[_wparam]);
m_hwnd[_wparam] = 0;
if (0 == handle.idx)
{
m_exit = true;
m_eventQueue.postExitEvent();
}
}
break;
@@ -615,15 +620,7 @@ namespace entry
case WM_QUIT:
case WM_CLOSE:
if (_hwnd == m_hwnd[0])
{
m_exit = true;
m_eventQueue.postExitEvent();
}
else
{
destroyWindow(findHandle(_hwnd) );
}
destroyWindow(findHandle(_hwnd) );
// Don't process message. Window will be destroyed later.
return 0;