summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DolphinWX/Main.cpp')
-rw-r--r--Source/Core/DolphinWX/Main.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp
index 934697ddab..91133a4e57 100644
--- a/Source/Core/DolphinWX/Main.cpp
+++ b/Source/Core/DolphinWX/Main.cpp
@@ -91,7 +91,6 @@ bool DolphinApp::OnCmdLineParsed(wxCmdLineParser& parser)
bool DolphinApp::OnInit()
{
- std::lock_guard<std::mutex> lk(s_init_mutex);
if (!wxApp::OnInit())
return false;
@@ -108,8 +107,20 @@ bool DolphinApp::OnInit()
wxHandleFatalExceptions(true);
#endif
+#ifdef _WIN32
+ const bool console_attached = AttachConsole(ATTACH_PARENT_PROCESS) != FALSE;
+ HANDLE stdout_handle = ::GetStdHandle(STD_OUTPUT_HANDLE);
+ if (console_attached && stdout_handle)
+ {
+ freopen("CONOUT$", "w", stdout);
+ freopen("CONOUT$", "w", stderr);
+ }
+#endif
+
ParseCommandLine();
+ std::lock_guard<std::mutex> lk(s_init_mutex);
+
UICommon::SetUserDirectory(m_user_path.ToStdString());
UICommon::CreateDirectories();
InitLanguageSupport(); // The language setting is loaded from the user directory