diff --git a/library/Console-windows.cpp b/library/Console-windows.cpp index dd8ce9d84..20d943b18 100644 --- a/library/Console-windows.cpp +++ b/library/Console-windows.cpp @@ -508,7 +508,7 @@ bool Console::init(bool) inited = true; // DOESN'T WORK - locks up DF! // ForceForegroundWindow(d->MainWindow); - SetForegroundWindow(d->MainWindow); + hide(); return true; } // FIXME: looks awfully empty, doesn't it? @@ -609,7 +609,6 @@ void Console::msleep (unsigned int msec) bool Console::hide() { ShowWindow( GetConsoleWindow(), SW_HIDE ); - SetForegroundWindow(d->MainWindow); return true; } diff --git a/library/Core.cpp b/library/Core.cpp index f1bb28925..9ff6976d5 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -1304,10 +1304,6 @@ static void run_dfhack_init(color_ostream &out, Core *core) return; } - // if we're running on Steam Deck, hide the terminal by default - if (DFSteam::DFIsSteamRunningOnSteamDeck()) - core->getConsole().hide(); - // load baseline defaults core->loadScriptFile(out, CONFIG_PATH + "init/default.dfhack.init", false); @@ -1315,13 +1311,13 @@ static void run_dfhack_init(color_ostream &out, Core *core) std::vector prefixes(1, "dfhack"); loadScriptFiles(core, out, prefixes, CONFIG_PATH + "init"); - // if the option is set, hide the terminal + // show the terminal if requested auto L = Lua::Core::State; Lua::StackUnwinder top(L); Lua::CallLuaModuleFunction(out, L, "dfhack", "getHideConsoleOnStartup", 0, 1, Lua::DEFAULT_LUA_LAMBDA, [&](lua_State* L) { - if (lua_toboolean(L, -1)) - core->getConsole().hide(); + if (!lua_toboolean(L, -1)) + core->getConsole().show(); }, false); }