diff options
author | Paulo Poiati <paulogpoiati@gmail.com> | 2024-05-22 09:06:04 -0300 |
---|---|---|
committer | Paulo Poiati <paulogpoiati@gmail.com> | 2024-05-22 10:42:12 -0300 |
commit | a3769c0edc4633224e6291866d750691e6d9ed36 (patch) | |
tree | 95f3edb8292df85d75349ed406a09ec3aca7a048 /main | |
parent | 8e2141eac534f6984bb0bdbcefbd17de27ae0993 (diff) | |
download | redot-engine-a3769c0edc4633224e6291866d750691e6d9ed36.tar.gz |
Properly set window class in Wayland
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/main/main.cpp b/main/main.cpp index 65f637d778..20ffdf5ae1 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -2686,9 +2686,18 @@ Error Main::setup2() { Color boot_bg_color = GLOBAL_DEF_BASIC("application/boot_splash/bg_color", boot_splash_bg_color); DisplayServer::set_early_window_clear_color_override(true, boot_bg_color); + DisplayServer::Context context; + if (editor) { + context = DisplayServer::CONTEXT_EDITOR; + } else if (project_manager) { + context = DisplayServer::CONTEXT_PROJECTMAN; + } else { + context = DisplayServer::CONTEXT_ENGINE; + } + // rendering_driver now held in static global String in main and initialized in setup() Error err; - display_server = DisplayServer::create(display_driver_idx, rendering_driver, window_mode, window_vsync_mode, window_flags, window_position, window_size, init_screen, err); + display_server = DisplayServer::create(display_driver_idx, rendering_driver, window_mode, window_vsync_mode, window_flags, window_position, window_size, init_screen, context, err); if (err != OK || display_server == nullptr) { // We can't use this display server, try other ones as fallback. // Skip headless (always last registered) because that's not what users @@ -2697,7 +2706,7 @@ Error Main::setup2() { if (i == display_driver_idx) { continue; // Don't try the same twice. } - display_server = DisplayServer::create(i, rendering_driver, window_mode, window_vsync_mode, window_flags, window_position, window_size, init_screen, err); + display_server = DisplayServer::create(i, rendering_driver, window_mode, window_vsync_mode, window_flags, window_position, window_size, init_screen, context, err); if (err == OK && display_server != nullptr) { break; } @@ -3807,16 +3816,12 @@ int Main::start() { ERR_PRINT("Failed to load scene"); } } - DisplayServer::get_singleton()->set_context(DisplayServer::CONTEXT_EDITOR); if (!debug_server_uri.is_empty()) { EditorDebuggerNode::get_singleton()->start(debug_server_uri); EditorDebuggerNode::get_singleton()->set_keep_open(true); } } #endif - if (!editor) { - DisplayServer::get_singleton()->set_context(DisplayServer::CONTEXT_ENGINE); - } } if (!project_manager && !editor) { // game @@ -3874,7 +3879,6 @@ int Main::start() { ProgressDialog *progress_dialog = memnew(ProgressDialog); pmanager->add_child(progress_dialog); sml->get_root()->add_child(pmanager); - DisplayServer::get_singleton()->set_context(DisplayServer::CONTEXT_PROJECTMAN); OS::get_singleton()->benchmark_end_measure("Startup", "Project Manager"); } |