diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2024-09-20 17:07:11 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2024-09-20 18:16:45 +0200 |
commit | 107675f785912a17474ffcc8fa8bd762f2a73233 (patch) | |
tree | a83de6c96e6a4d83e188c0bb1dadacfd32949b53 /editor/editor_node.cpp | |
parent | 2be730a05b7ff221b89c967981f7caee6e164ef0 (diff) | |
download | redot-engine-107675f785912a17474ffcc8fa8bd762f2a73233.tar.gz |
Mention display driver and window mode in Copy System Info text
This is useful information to know, as the X11 display driver can be
used both on X11 natively and on Wayland through XWayland.
Certain editor issues only occur in multi-window mode
(or only in single-window mode). Some issues also only occur
on multi-monitor setups, so the monitor count is now listed.
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 2b4b6a5b7e..b4f8257d8a 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4956,8 +4956,10 @@ String EditorNode::_get_system_info() const { godot_version += " " + hash; } + String display_session_type; #ifdef LINUXBSD_ENABLED - const String display_server = OS::get_singleton()->get_environment("XDG_SESSION_TYPE").capitalize().replace(" ", ""); // `replace` is necessary, because `capitalize` introduces a whitespace between "x" and "11". + // `replace` is necessary, because `capitalize` introduces a whitespace between "x" and "11". + display_session_type = OS::get_singleton()->get_environment("XDG_SESSION_TYPE").capitalize().replace(" ", ""); #endif // LINUXBSD_ENABLED String driver_name = OS::get_singleton()->get_current_rendering_driver_name().to_lower(); String rendering_method = OS::get_singleton()->get_current_rendering_method().to_lower(); @@ -5018,16 +5020,33 @@ String EditorNode::_get_system_info() const { // Join info. Vector<String> info; info.push_back(godot_version); + String distribution_display_session_type = distribution_name; if (!distribution_version.is_empty()) { - info.push_back(distribution_name + " " + distribution_version); - } else { - info.push_back(distribution_name); + distribution_display_session_type += " " + distribution_version; } -#ifdef LINUXBSD_ENABLED - if (!display_server.is_empty()) { - info.push_back(display_server); + if (!display_session_type.is_empty()) { + distribution_display_session_type += " on " + display_session_type; } + info.push_back(distribution_display_session_type); + + String display_driver_window_mode; +#ifdef LINUXBSD_ENABLED + // `replace` is necessary, because `capitalize` introduces a whitespace between "x" and "11". + display_driver_window_mode = DisplayServer::get_singleton()->get_name().capitalize().replace(" ", "") + " display driver"; #endif // LINUXBSD_ENABLED + if (!display_driver_window_mode.is_empty()) { + display_driver_window_mode += ", "; + } + display_driver_window_mode += get_viewport()->is_embedding_subwindows() ? "Single-window" : "Multi-window"; + + if (DisplayServer::get_singleton()->get_screen_count() == 1) { + display_driver_window_mode += ", " + itos(DisplayServer::get_singleton()->get_screen_count()) + " monitor"; + } else { + display_driver_window_mode += ", " + itos(DisplayServer::get_singleton()->get_screen_count()) + " monitors"; + } + + info.push_back(display_driver_window_mode); + info.push_back(vformat("%s (%s)", driver_name, rendering_method)); String graphics; @@ -5046,7 +5065,7 @@ String EditorNode::_get_system_info() const { } info.push_back(graphics); - info.push_back(vformat("%s (%d Threads)", processor_name, processor_count)); + info.push_back(vformat("%s (%d threads)", processor_name, processor_count)); return String(" - ").join(info); } |