Bug 1679076 - Recognize sway as desktop environment. r=gfx-reviewers,jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D127986
This commit is contained in:
Lukas Bernhard 2021-10-29 12:23:58 +00:00
Родитель 9351b5fb52
Коммит add789c413
3 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -812,6 +812,7 @@ const nsAString& GfxDriverInfo::GetDesktopEnvironment(DesktopEnvironment id) {
DECLARE_DESKTOP_ENVIRONMENT_ID(LXDE, "lxde");
DECLARE_DESKTOP_ENVIRONMENT_ID(Openbox, "openbox");
DECLARE_DESKTOP_ENVIRONMENT_ID(i3, "i3");
DECLARE_DESKTOP_ENVIRONMENT_ID(Sway, "sway");
DECLARE_DESKTOP_ENVIRONMENT_ID(Mate, "mate");
DECLARE_DESKTOP_ENVIRONMENT_ID(Unity, "unity");
DECLARE_DESKTOP_ENVIRONMENT_ID(Pantheon, "pantheon");

Просмотреть файл

@ -268,6 +268,7 @@ enum class DesktopEnvironment : uint8_t {
Deepin,
Dwm,
Budgie,
Sway,
Unknown,
Max
};

Просмотреть файл

@ -540,6 +540,10 @@ void GfxInfo::GetData() {
CopyUTF16toUTF8(
GfxDriverInfo::GetDesktopEnvironment(DesktopEnvironment::i3),
mDesktopEnvironment);
} else if (currentDesktop.find("sway") != std::string::npos) {
CopyUTF16toUTF8(
GfxDriverInfo::GetDesktopEnvironment(DesktopEnvironment::Sway),
mDesktopEnvironment);
} else if (currentDesktop.find("mate") != std::string::npos) {
CopyUTF16toUTF8(
GfxDriverInfo::GetDesktopEnvironment(DesktopEnvironment::Mate),