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:
authorNathan Letwory <nathan@letworyinteractive.com>2011-04-08 16:49:38 +0400
committerNathan Letwory <nathan@letworyinteractive.com>2011-04-08 16:49:38 +0400
commit2b955490795892f702b87247fd5c5f35124b7c1d (patch)
tree742b1a215e5dfc2a577eec30d12c54cebd6cb2ca /source/blender/windowmanager/intern/wm_init_exit.c
parent0f5959abd9add48ff94d9a627e9897f917cd5cd8 (diff)
Apply console part of patch [#26044] Windows thumbnails and improved filetype registration
submitted by Tom Edwards This patch introduces a switch -con and its longer version --start-console. When giving this on cmd-line you'll get the black console window. The new behaviour is to hide it by default. We'll still see briefly the console at startup and during exit, but that's something that cannot be changed. If you start blender from a cmd.exe, the console will not be hidden.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_init_exit.c')
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 0d88f8ea1a6..38e66bc9f06 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -63,6 +63,7 @@
#include "BKE_material.h" /* clear_matcopybuf */
#include "BLI_blenlib.h"
+#include "BLI_winstuff.h"
#include "RE_pipeline.h" /* RE_ free stuff */
@@ -114,7 +115,7 @@ static void wm_free_reports(bContext *C)
BKE_reports_clear(CTX_wm_reports(C));
}
-
+int wm_start_with_console = 0;
/* only called once, for startup */
void WM_init(bContext *C, int argc, const char **argv)
@@ -123,6 +124,10 @@ void WM_init(bContext *C, int argc, const char **argv)
if (!G.background) {
wm_ghost_init(C); /* note: it assigns C to ghost! */
wm_init_cursor_data();
+#ifdef WIN32
+ if (IsConsoleEmpty()) /* never hide if the console window pre-existed */
+ WM_console_toggle(C, wm_start_with_console);
+#endif
}
GHOST_CreateSystemPaths();
@@ -352,6 +357,8 @@ void WM_exit(bContext *C)
sound_exit();
+ WM_console_toggle(C, 1); /* never leave behind invisible consoles */
+
/* first wrap up running stuff, we assume only the active WM is running */
/* modal handlers are on window level freed, others too? */
/* note; same code copied in wm_files.c */