diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-05-02 12:07:24 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-05-02 12:07:24 +0400 |
commit | d197ec74e31c0a90b440246e5c48dd0644055740 (patch) | |
tree | 0623a838e26a1cb1c84b807b1abdb1b6051ebc94 /source/blender | |
parent | 17451136390980fc26e971cd7fb8308a509bb22d (diff) |
Fix [#26981] Command window is not opening in 2.57.0
Reported by Thomas Engel
Fix [#26938] Blender Zoom not working after startup (Windows)
Reported by Ilija Boshkov
by applying patch [#26881] Fix for console disappearing in debug mode [Windows]
Submitted by Alexander Kuznetsov (AlexK)
The patch moves console toggling code into GHOST and improves on the toggling behaviour.
The patch changes handling of WM_SYSCOMMAND so that alt-key toggling isn't a problem anymore.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenlib/BLI_winstuff.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/winstuff.c | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 17 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 29 |
4 files changed, 6 insertions, 49 deletions
diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index 176e7319bf7..d0eb3c7d67d 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -127,7 +127,6 @@ typedef struct _DIR { struct dirent direntry; } DIR; -int IsConsoleEmpty(void); void RegisterBlendExtension(void); DIR *opendir (const char *path); struct dirent *readdir(DIR *dp); diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 596ab2b0470..66080ed2a85 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -66,14 +66,6 @@ int BLI_getInstallationDir( char * str ) { return 1; } -int IsConsoleEmpty(void) -{ - CONSOLE_SCREEN_BUFFER_INFO csbi = {{0}}; - HANDLE hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); - - return GetConsoleScreenBufferInfo(hStdOutput, &csbi) && csbi.dwCursorPosition.X == 0 && csbi.dwCursorPosition.Y == 0; -} - void RegisterBlendExtension_Fail(HKEY root) { printf("failed\n"); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 58485b1f544..620d3314d43 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -75,6 +75,7 @@ #include "SYS_System.h" #endif #include "GHOST_Path-api.h" +#include "GHOST_C-api.h" #include "RNA_define.h" @@ -104,7 +105,6 @@ #include "BKE_depsgraph.h" #include "BKE_sound.h" -#include "GHOST_C-api.h" static void wm_init_reports(bContext *C) { @@ -120,17 +120,11 @@ int wm_start_with_console = 0; /* only called once, for startup */ 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(); - wm_operatortype_init(); set_free_windowmanager_cb(wm_close_and_free); /* library.c */ @@ -144,7 +138,6 @@ void WM_init(bContext *C, int argc, const char **argv) BLF_init(11, U.dpi); /* Please update source/gamengine/GamePlayer/GPG_ghost.cpp if you change this */ BLF_lang_init(); - /* get the default database, plus a wm */ WM_read_homefile(C, NULL, G.factory_startup); @@ -167,6 +160,9 @@ void WM_init(bContext *C, int argc, const char **argv) (void)argv; /* unused */ #endif + if (!G.background && !wm_start_with_console) + GHOST_toggleConsole(3); + wm_init_reports(C); /* reports cant be initialized before the wm */ if (!G.background) { @@ -194,7 +190,6 @@ void WM_init(bContext *C, int argc, const char **argv) */ BLI_strncpy(G.lib, G.main->name, FILE_MAX); - } void WM_init_splash(bContext *C) @@ -357,9 +352,6 @@ void WM_exit(bContext *C) sound_exit(); -#ifdef WIN32 - WM_console_toggle(C, 1); /* never leave behind invisible consoles */ -#endif /* first wrap up running stuff, we assume only the active WM is running */ /* modal handlers are on window level freed, others too? */ @@ -481,7 +473,6 @@ void WM_exit(bContext *C) getchar(); } #endif - exit(G.afbreek==1); } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 100dd914026..fd39755607f 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -38,12 +38,7 @@ #include <stddef.h> #include <assert.h> -#ifdef WIN32 -#include "BLI_winstuff.h" -#include <windows.h> - -#include <io.h> -#endif +#include "GHOST_C-api.h" #include "MEM_guardedalloc.h" @@ -2001,7 +1996,6 @@ static void WM_OT_collada_import(wmOperatorType *ot) #endif - /* *********************** */ static void WM_OT_window_fullscreen_toggle(wmOperatorType *ot) @@ -2035,28 +2029,10 @@ static void WM_OT_quit_blender(wmOperatorType *ot) } /* *********************** */ -#if defined(WIN32) -static int console= 1; -void WM_console_toggle(bContext *UNUSED(C), short show) -{ - if(show) { - ShowWindow(GetConsoleWindow(),SW_SHOW); - console= 1; - } - else { - ShowWindow(GetConsoleWindow(),SW_HIDE); - console= 0; - } -} static int wm_console_toggle_op(bContext *C, wmOperator *UNUSED(op)) { - if(console) { - WM_console_toggle(C, 0); - } - else { - WM_console_toggle(C, 1); - } + GHOST_toggleConsole(2); return OPERATOR_FINISHED; } @@ -2069,7 +2045,6 @@ static void WM_OT_console_toggle(wmOperatorType *ot) ot->exec= wm_console_toggle_op; ot->poll= WM_operator_winactive; } -#endif /* ************ default paint cursors, draw always around cursor *********** */ /* |