UI: Win32 - Restore Minimized App On WM_Close

Changes needed for Windows 10 to restore and show close dialog from minimized state.

https://developer.blender.org/D5107

Reviewed by Brecht Van Lommel
This commit is contained in:
Harley Acheson 2020-01-27 10:41:39 -08:00
parent f357740a80
commit 22ca8b8aee
4 changed files with 16 additions and 3 deletions

View File

@ -443,6 +443,13 @@ bool GHOST_SystemWin32::processEvents(bool waitForEvent)
::DispatchMessageW(&msg);
hasEventHandled = true;
}
/* PeekMessage above is allowed to dispatch messages to the wndproc without us
* noticing, so we need to check the event manager here to see if there are
* events waiting in the queue.
*/
hasEventHandled |= this->m_eventManager->getNumEvents() > 0;
} while (waitForEvent && !hasEventHandled);
return hasEventHandled;
@ -1453,7 +1460,10 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
////////////////////////////////////////////////////////////////////////
case WM_CLOSE:
/* The WM_CLOSE message is sent as a signal that a window
* or an application should terminate. */
* or an application should terminate. Restore if minimized. */
if (IsIconic(hwnd)) {
ShowWindow(hwnd, SW_RESTORE);
}
event = processWindowEvent(GHOST_kEventWindowClose, window);
break;
case WM_ACTIVATE:

View File

@ -644,6 +644,9 @@ GHOST_TSuccess GHOST_WindowWin32::setOrder(GHOST_TWindowOrder order)
hWndToRaise = ::GetWindow(m_hWnd, GW_HWNDNEXT); /* the window to raise */
}
else {
if (getState() == GHOST_kWindowStateMinimized) {
setState(GHOST_kWindowStateNormal);
}
hWndInsertAfter = HWND_TOP;
hWndToRaise = NULL;
}

@ -1 +1 @@
Subproject commit 19f3349d204303ae90e31939d5bf3f0c4fe9df42
Subproject commit 74afb3ed35e3271b2609feaf67bea6b8bdffe7ca

@ -1 +1 @@
Subproject commit 71ac0b888beb3f057915446e3e7c92c44f1c4ee8
Subproject commit 47a32a5370d36942674621e5a03e57e8dd4986d8