diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/main/main.cpp b/main/main.cpp index 14b6ac29ec..0c6de4325c 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "main.h" + #include "app_icon.gen.h" #include "core/register_core_types.h" #include "drivers/register_driver_types.h" @@ -112,6 +113,8 @@ static bool use_vsync = true; static bool editor = false; static bool show_help = false; +static OS::ProcessID allow_focus_steal_pid = 0; + static String unescape_cmdline(const String &p_str) { return p_str.replace("%20", " "); @@ -179,7 +182,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print("Debug options:\n"); OS::get_singleton()->print(" -d, --debug Debug (local stdout debugger).\n"); - OS::get_singleton()->print(" -b, --breakpoints Breakpoint list as source::line comma-separated pairs, no spaces (use %%20, %%2C, etc. instead).\n"); + OS::get_singleton()->print(" -b, --breakpoints Breakpoint list as source::line comma-separated pairs, no spaces (use %%20 instead).\n"); OS::get_singleton()->print(" --profiling Enable profiling in the script debugger.\n"); OS::get_singleton()->print(" --remote-debug <address> Remote debug (<host/IP>:<port> address).\n"); #ifdef DEBUG_ENABLED @@ -282,8 +285,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph bool use_custom_res = true; bool force_res = false; - I = args.front(); - packed_data = PackedData::get_singleton(); if (!packed_data) packed_data = memnew(PackedData); @@ -300,6 +301,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph packed_data->add_pack_source(zip_packed_data); #endif + I = args.front(); while (I) { List<String>::Element *N = I->next(); @@ -557,11 +559,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->print("Missing remote debug host address, aborting.\n"); goto error; } - } else if (I->get() == "--editor-pid") { // not exposed to user + } else if (I->get() == "--allow_focus_steal_pid") { // not exposed to user if (I->next()) { - int editor_pid = I->next()->get().to_int(); - ProjectSettings::get_singleton()->set("editor_pid", editor_pid); + allow_focus_steal_pid = I->next()->get().to_int64(); N = I->next()->next(); } else { OS::get_singleton()->print("Missing editor PID argument, aborting.\n"); @@ -671,6 +672,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } if (editor) { + Engine::get_singleton()->set_editor_hint(true); main_args.push_back("--editor"); init_maximized = true; use_custom_res = false; @@ -902,9 +904,10 @@ Error Main::setup2() { MAIN_PRINT("Main: Setup Logo"); - bool show_logo = true; #ifdef JAVASCRIPT_ENABLED - show_logo = false; + bool show_logo = false; +#else + bool show_logo = true; #endif if (init_screen != -1) { @@ -1012,6 +1015,10 @@ Error Main::setup2() { #endif + if (allow_focus_steal_pid) { + OS::get_singleton()->enable_for_stealing_focus(allow_focus_steal_pid); + } + MAIN_PRINT("Main: Load Scripts, Modules, Drivers"); register_module_types(); |