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:
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Submodule release/datafiles/locale updated: 19f3349d20...74afb3ed35
Submodule release/scripts/addons updated: 71ac0b888b...47a32a5370
Reference in New Issue
Block a user