[Bf-blender-cvs] [22ca8b8aee9] master: UI: Win32 - Restore Minimized App On WM_Close
Harley Acheson
noreply at git.blender.org
Mon Jan 27 19:43:45 CET 2020
Commit: 22ca8b8aee9955292b838ac92d08566bcaee3e25
Author: Harley Acheson
Date: Mon Jan 27 10:41:39 2020 -0800
Branches: master
https://developer.blender.org/rB22ca8b8aee9955292b838ac92d08566bcaee3e25
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
===================================================================
M intern/ghost/intern/GHOST_SystemWin32.cpp
M intern/ghost/intern/GHOST_WindowWin32.cpp
M release/datafiles/locale
M release/scripts/addons
===================================================================
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 31a6ea96bc3..4a4016cbca1 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -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:
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index e91dba5cef8..2ab0e837efb 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -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;
}
diff --git a/release/datafiles/locale b/release/datafiles/locale
index 19f3349d204..74afb3ed35e 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 19f3349d204303ae90e31939d5bf3f0c4fe9df42
+Subproject commit 74afb3ed35e3271b2609feaf67bea6b8bdffe7ca
diff --git a/release/scripts/addons b/release/scripts/addons
index 71ac0b888be..47a32a5370d 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 71ac0b888beb3f057915446e3e7c92c44f1c4ee8
+Subproject commit 47a32a5370d36942674621e5a03e57e8dd4986d8
More information about the Bf-blender-cvs
mailing list