--single-window is passed through project manager.
This means you can start godot with --single-window
This commit is contained in:
parent
173c0f8737
commit
2b292a1a2a
4 changed files with 13 additions and 3 deletions
|
@ -146,6 +146,10 @@ bool OS::is_stdout_verbose() const {
|
||||||
return _verbose_stdout;
|
return _verbose_stdout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OS::is_single_window() const {
|
||||||
|
return _single_window;
|
||||||
|
}
|
||||||
|
|
||||||
bool OS::is_stdout_debug_enabled() const {
|
bool OS::is_stdout_debug_enabled() const {
|
||||||
return _debug_stdout;
|
return _debug_stdout;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ class OS {
|
||||||
int low_processor_usage_mode_sleep_usec = 10000;
|
int low_processor_usage_mode_sleep_usec = 10000;
|
||||||
bool _verbose_stdout = false;
|
bool _verbose_stdout = false;
|
||||||
bool _debug_stdout = false;
|
bool _debug_stdout = false;
|
||||||
|
bool _single_window = false;
|
||||||
String _local_clipboard;
|
String _local_clipboard;
|
||||||
int _exit_code = EXIT_FAILURE; // unexpected exit is marked as failure
|
int _exit_code = EXIT_FAILURE; // unexpected exit is marked as failure
|
||||||
int _orientation;
|
int _orientation;
|
||||||
|
@ -224,6 +225,8 @@ public:
|
||||||
void set_stdout_enabled(bool p_enabled);
|
void set_stdout_enabled(bool p_enabled);
|
||||||
void set_stderr_enabled(bool p_enabled);
|
void set_stderr_enabled(bool p_enabled);
|
||||||
|
|
||||||
|
bool is_single_window() const;
|
||||||
|
|
||||||
virtual void disable_crash_handler() {}
|
virtual void disable_crash_handler() {}
|
||||||
virtual bool is_disable_crash_handler() const { return false; }
|
virtual bool is_disable_crash_handler() const { return false; }
|
||||||
virtual void initialize_debugging() {}
|
virtual void initialize_debugging() {}
|
||||||
|
|
|
@ -2051,6 +2051,10 @@ void ProjectManager::_open_selected_projects() {
|
||||||
args.push_back("--disable-crash-handler");
|
args.push_back("--disable-crash-handler");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OS::get_singleton()->is_single_window()) {
|
||||||
|
args.push_back("--single-window");
|
||||||
|
}
|
||||||
|
|
||||||
String exec = OS::get_singleton()->get_executable_path();
|
String exec = OS::get_singleton()->get_executable_path();
|
||||||
Error err = OS::get_singleton()->create_process(exec, args);
|
Error err = OS::get_singleton()->create_process(exec, args);
|
||||||
ERR_FAIL_COND(err);
|
ERR_FAIL_COND(err);
|
||||||
|
|
|
@ -135,7 +135,6 @@ static int audio_driver_idx = -1;
|
||||||
|
|
||||||
// Engine config/tools
|
// Engine config/tools
|
||||||
|
|
||||||
static bool single_window = false;
|
|
||||||
static bool editor = false;
|
static bool editor = false;
|
||||||
static bool project_manager = false;
|
static bool project_manager = false;
|
||||||
static bool cmdline_tool = false;
|
static bool cmdline_tool = false;
|
||||||
|
@ -755,7 +754,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
||||||
}
|
}
|
||||||
} else if (I->get() == "--single-window") { // force single window
|
} else if (I->get() == "--single-window") { // force single window
|
||||||
|
|
||||||
single_window = true;
|
OS::get_singleton()->_single_window = true;
|
||||||
} else if (I->get() == "-t" || I->get() == "--always-on-top") { // force always-on-top window
|
} else if (I->get() == "-t" || I->get() == "--always-on-top") { // force always-on-top window
|
||||||
|
|
||||||
init_always_on_top = true;
|
init_always_on_top = true;
|
||||||
|
@ -2131,7 +2130,7 @@ bool Main::start() {
|
||||||
|
|
||||||
bool embed_subwindows = GLOBAL_DEF("display/window/subwindows/embed_subwindows", false);
|
bool embed_subwindows = GLOBAL_DEF("display/window/subwindows/embed_subwindows", false);
|
||||||
|
|
||||||
if (single_window || (!project_manager && !editor && embed_subwindows)) {
|
if (OS::get_singleton()->is_single_window() || (!project_manager && !editor && embed_subwindows)) {
|
||||||
sml->get_root()->set_embed_subwindows_hint(true);
|
sml->get_root()->set_embed_subwindows_hint(true);
|
||||||
}
|
}
|
||||||
ResourceLoader::add_custom_loaders();
|
ResourceLoader::add_custom_loaders();
|
||||||
|
|
Loading…
Reference in a new issue