diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-22 17:30:21 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-22 17:30:21 +0200 |
commit | 84af5c1c46d2fa78816268c86d4f2e08e354b11c (patch) | |
tree | 77efdc6cb530f93edf5251141a32ed94e9d2e92b /main | |
parent | 40c66680444ddf29a505e992ae81720037a29ef8 (diff) | |
parent | 2677af779415fac6ddca13025ce63418657f6107 (diff) | |
download | redot-engine-84af5c1c46d2fa78816268c86d4f2e08e354b11c.tar.gz |
Merge pull request #88065 from Riteo/ds-pref-consistent
Handle display driver preferences consistently between editor and projects
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/main/main.cpp b/main/main.cpp index bbb16d1507..e1d53e7f1b 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -2326,12 +2326,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // Make sure that headless is the last one, which it is assumed to be by design. DEV_ASSERT(NULL_DISPLAY_DRIVER == DisplayServer::get_create_function_name(DisplayServer::get_create_function_count() - 1)); - GLOBAL_DEF_RST_NOVAL("display/display_server/driver", "default"); - GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "display/display_server/driver.windows", PROPERTY_HINT_ENUM_SUGGESTION, "default,windows,headless"), "default"); - GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "display/display_server/driver.linuxbsd", PROPERTY_HINT_ENUM_SUGGESTION, "default,x11,wayland,headless"), "default"); - GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "display/display_server/driver.android", PROPERTY_HINT_ENUM_SUGGESTION, "default,android,headless"), "default"); - GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "display/display_server/driver.ios", PROPERTY_HINT_ENUM_SUGGESTION, "default,iOS,headless"), "default"); - GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "display/display_server/driver.macos", PROPERTY_HINT_ENUM_SUGGESTION, "default,macos,headless"), "default"); + GLOBAL_DEF_NOVAL("display/display_server/driver", "default"); + GLOBAL_DEF_NOVAL(PropertyInfo(Variant::STRING, "display/display_server/driver.windows", PROPERTY_HINT_ENUM_SUGGESTION, "default,windows,headless"), "default"); + GLOBAL_DEF_NOVAL(PropertyInfo(Variant::STRING, "display/display_server/driver.linuxbsd", PROPERTY_HINT_ENUM_SUGGESTION, "default,x11,wayland,headless"), "default"); + GLOBAL_DEF_NOVAL(PropertyInfo(Variant::STRING, "display/display_server/driver.android", PROPERTY_HINT_ENUM_SUGGESTION, "default,android,headless"), "default"); + GLOBAL_DEF_NOVAL(PropertyInfo(Variant::STRING, "display/display_server/driver.ios", PROPERTY_HINT_ENUM_SUGGESTION, "default,iOS,headless"), "default"); + GLOBAL_DEF_NOVAL(PropertyInfo(Variant::STRING, "display/display_server/driver.macos", PROPERTY_HINT_ENUM_SUGGESTION, "default,macos,headless"), "default"); GLOBAL_DEF_RST_NOVAL("audio/driver/driver", AudioDriverManager::get_driver(0)->get_name()); if (audio_driver.is_empty()) { // Specified in project.godot. @@ -2592,6 +2592,7 @@ Error Main::setup2(bool p_show_boot_logo) { String screen_property; bool prefer_wayland_found = false; + bool prefer_wayland = false; if (editor) { screen_property = "interface/editor/editor_screen"; @@ -2624,16 +2625,17 @@ Error Main::setup2(bool p_show_boot_logo) { } if (!prefer_wayland_found && assign == "run/platforms/linuxbsd/prefer_wayland") { - if (value) { - display_driver = "wayland"; - } else { - display_driver = "default"; - } - + prefer_wayland = value; prefer_wayland_found = true; } } } + + if (prefer_wayland) { + display_driver = "wayland"; + } else { + display_driver = "default"; + } } } } |