diff options
| author | Juan Linietsky <reduzio@gmail.com> | 2017-08-20 23:42:54 -0300 |
|---|---|---|
| committer | Juan Linietsky <reduzio@gmail.com> | 2017-08-20 23:42:54 -0300 |
| commit | 533014b88c964044441dc04dce6e757b0776de97 (patch) | |
| tree | 2a31350e0a9509fbd9b7501fdf8fd494dd61f7ec /main | |
| parent | 0bdbe370bf68a42cf41f3dbe68a094a9a982c7d9 (diff) | |
| download | redot-engine-533014b88c964044441dc04dce6e757b0776de97.tar.gz | |
simplify the way window is allowed to steal focus, no longer relying on project.godot. Closes #9459
Diffstat (limited to 'main')
| -rw-r--r-- | main/main.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/main/main.cpp b/main/main.cpp index 5d4c26ea89..562388af88 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -111,6 +111,8 @@ static int init_screen = -1; static bool use_vsync = true; static bool editor = false; +static OS::ProcessID allow_focus_steal_pid = 0; + static String unescape_cmdline(const String &p_str) { return p_str.replace("%20", " "); @@ -547,11 +549,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else { goto error; } - } else if (I->get() == "-epid") { + } else if (I->get() == "-allow_focus_steal_pid") { 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 { goto error; @@ -1001,6 +1002,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(); |
