[Bf-blender-cvs] [a5dd1bc53d4] master: Fix T90868: Console window flash when exiting

Shrey Aggarwal noreply at git.blender.org
Mon Feb 7 16:20:17 CET 2022


Commit: a5dd1bc53d4bf7994745124f58de674068d1d598
Author: Shrey Aggarwal
Date:   Mon Feb 7 08:20:12 2022 -0700
Branches: master
https://developer.blender.org/rBa5dd1bc53d4bf7994745124f58de674068d1d598

Fix T90868: Console window flash when exiting

If the console was hidden on windows, it would
be made visible during shutdown in an effort
not hide a potentially active interactive console
session. This however did not take in account
if blender was actually launched from an interactive
console causing the console window to briefly flash
during shutdown even when launched from the new
launcher, the brief flash concerned some users.

This change adjusts the behaviour to restore the
console only when blender was started from the
console.

Reviewed By: LazyDodo
Differential Revision: https://developer.blender.org/D14016

===================================================================

M	intern/ghost/intern/GHOST_SystemWin32.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 64e1ac3b9b3..923453d6c6f 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -105,6 +105,8 @@
  */
 #define BROKEN_PEEK_TOUCHPAD
 
+static bool isStartedFromCommandPrompt();
+
 static void initRawInput()
 {
 #ifdef WITH_INPUT_NDOF
@@ -166,7 +168,10 @@ GHOST_SystemWin32::~GHOST_SystemWin32()
 {
   // Shutdown COM
   OleUninitialize();
-  toggleConsole(1);
+
+  if (isStartedFromCommandPrompt()) {
+    toggleConsole(1);
+  }
 }
 
 uint64_t GHOST_SystemWin32::performanceCounterToMillis(__int64 perf_ticks) const



More information about the Bf-blender-cvs mailing list