From 56eb272e9078bb11486ef38c35bdc05a5636341f Mon Sep 17 00:00:00 2001 From: Riteo Date: Fri, 10 May 2024 01:44:57 +0200 Subject: [PATCH] Warn when falling back to another DisplayServer Before it was a bit unclear on what was happening, since a display server has to fail to fall back and so the user would be left with an error _and_ a (hopefully) running game. Should make the experience more pleasant on Linux/BSD now that we have two display servers. --- main/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main/main.cpp b/main/main.cpp index f82df786bc2..51b4efa6bc8 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -2838,6 +2838,8 @@ Error Main::setup2(bool p_show_boot_logo) { Error 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) { + String last_name = DisplayServer::get_create_function_name(display_driver_idx); + // We can't use this display server, try other ones as fallback. // Skip headless (always last registered) because that's not what users // would expect if they didn't request it explicitly. @@ -2845,6 +2847,9 @@ Error Main::setup2(bool p_show_boot_logo) { if (i == display_driver_idx) { continue; // Don't try the same twice. } + String name = DisplayServer::get_create_function_name(i); + WARN_PRINT(vformat("Display driver %s failed, falling back to %s.", last_name, name)); + 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;