diff options
author | Shrey Aggarwal <shrey_agg> | 2022-02-07 18:20:12 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2022-02-07 18:20:12 +0300 |
commit | a5dd1bc53d4bf7994745124f58de674068d1d598 (patch) | |
tree | 8aa23c2832c3e2b5ace588313fb9a56ade380640 /intern/ghost | |
parent | b3bb51dd83a3a17f6fada77f6bed26758070f7ad (diff) |
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
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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 |