Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemWin32.cpp')
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 5251dd01b29..2f5395fc8d0 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()) {
+ setConsoleWindowState(GHOST_kConsoleWindowStateShow);
+ }
}
uint64_t GHOST_SystemWin32::performanceCounterToMillis(__int64 perf_ticks) const
@@ -1220,7 +1225,7 @@ GHOST_EventKey *GHOST_SystemWin32::processKeyEvent(GHOST_WindowWin32 *window, RA
}
#ifdef WITH_INPUT_IME
- if (window->getImeInput()->IsImeKeyEvent(ascii)) {
+ if (window->getImeInput()->IsImeKeyEvent(ascii, key)) {
return NULL;
}
#endif /* WITH_INPUT_IME */
@@ -2216,31 +2221,30 @@ static bool isStartedFromCommandPrompt()
return false;
}
-int GHOST_SystemWin32::toggleConsole(int action)
+int GHOST_SystemWin32::setConsoleWindowState(GHOST_TConsoleWindowState action)
{
HWND wnd = GetConsoleWindow();
switch (action) {
- case 3: // startup: hide if not started from command prompt
- {
+ case GHOST_kConsoleWindowStateHideForNonConsoleLaunch: {
if (!isStartedFromCommandPrompt()) {
ShowWindow(wnd, SW_HIDE);
m_consoleStatus = 0;
}
break;
}
- case 0: // hide
+ case GHOST_kConsoleWindowStateHide:
ShowWindow(wnd, SW_HIDE);
m_consoleStatus = 0;
break;
- case 1: // show
+ case GHOST_kConsoleWindowStateShow:
ShowWindow(wnd, SW_SHOW);
if (!isStartedFromCommandPrompt()) {
DeleteMenu(GetSystemMenu(wnd, FALSE), SC_CLOSE, MF_BYCOMMAND);
}
m_consoleStatus = 1;
break;
- case 2: // toggle
+ case GHOST_kConsoleWindowStateToggle:
ShowWindow(wnd, m_consoleStatus ? SW_HIDE : SW_SHOW);
m_consoleStatus = !m_consoleStatus;
if (m_consoleStatus && !isStartedFromCommandPrompt()) {