Linux: Show display backend of app on Troubleshoot dialog (#16615)

* init

* Update TroubleshootDialog.cpp

* fix build
This commit is contained in:
yw4z authored and GitHub committed 2026-10-18 22:45:30 +08:00
1 parent 1ee0b730a1
commit c1fb801ff3
2 files changed
+24 -1

No files matched your search

+23 -1
View File
@@ -74,6 +74,7 @@
#endif
#ifdef __LINUX__
#include "LinuxDisplayBackend.hpp"
#include <wx/textfile.h>
#include <wx/tokenzr.h>
#include <cstdlib>
@@ -201,7 +202,11 @@ TroubleshootDialog::TroubleshootDialog()
return std::vector<wxString>{GetOStype()};
return std::vector<wxString>{
GetOSinfo(),
#ifdef __LINUX__
GetPackageType() + GetAppDisplayBackend(),
#else
GetPackageType(),
#endif
GetCPUinfo(),
GetRAMinfo() + " RAM",
GetGPUinfo(),
@@ -434,10 +439,15 @@ wxString TroubleshootDialog::GetTimestamp()
wxString TroubleshootDialog::GetSysInfoAll()
{
wxString package = GetPackageType();
#ifdef __LINUX__
package += GetAppDisplayBackend();
#endif
wxString info;
info += "Version : " + wxString(SoftFever_VERSION) + "\n"
+ "Build : " + wxString(build_commit_label) + "\n"
+ "Package : " + GetPackageType() + "\n"
+ "Package : " + package + "\n"
+ "Platform : " + GetOSinfo() + "\n"
+ "Processor : " + GetCPUinfo() + "\n"
+ "Memory : " + GetRAMinfo() + "RAM" + "\n"
@@ -751,6 +761,18 @@ wxString TroubleshootDialog::GetLinuxDisplayServer()
return "";
}
wxString TroubleshootDialog::GetAppDisplayBackend()
{
// Display backend actually used by the app (GDK), not the session type
wxString display;
switch (get_linux_display_backend()) {
case LinuxDisplayBackend::X11: display = "X11"; break;
case LinuxDisplayBackend::Wayland: display = "Wayland"; break;
default: break;
}
return display.IsEmpty() ? "" : (" (" + display + ")"); // spacing included here to prevent non centered text
}
#endif
wxString TroubleshootDialog::GetPackageType()
+1
View File
@@ -68,6 +68,7 @@ protected:
#elif defined(__LINUX__)
wxString GetLinuxDistroName();
wxString GetLinuxDisplayServer();
wxString GetAppDisplayBackend();
#endif
wxString GetPackageType();
wxString GetCPUinfo();