Fixed awesome WM tray icon.

This commit is contained in:
Mike Zueff 2017-12-06 21:28:06 +03:00 committed by John Preston
parent 067138f1bf
commit 64e9958585
2 changed files with 9 additions and 1 deletions

View File

@ -73,6 +73,8 @@ Type Compute() {
return Type::KDE3; return Type::KDE3;
} else if (desktopSession.indexOf(qstr("xfce")) >= 0 || desktopSession == qstr("xubuntu")) { } else if (desktopSession.indexOf(qstr("xfce")) >= 0 || desktopSession == qstr("xubuntu")) {
return Type::XFCE; return Type::XFCE;
} else if (desktopSession == qstr("awesome")) {
return Type::Awesome;
} }
} }
@ -102,6 +104,7 @@ Type ComputeAndLog() {
case Type::Unity: return "Unity"; case Type::Unity: return "Unity";
case Type::XFCE: return "XFCE"; case Type::XFCE: return "XFCE";
case Type::Pantheon: return "Pantheon"; case Type::Pantheon: return "Pantheon";
case Type::Awesome: return "Awesome";
} }
return QString::number(static_cast<int>(result)); return QString::number(static_cast<int>(result));
}; };
@ -118,7 +121,7 @@ Type Get() {
} }
bool TryQtTrayIcon() { bool TryQtTrayIcon() {
return !IsPantheon(); return !IsPantheon() && !IsAwesome();
} }
bool PreferAppIndicatorTrayIcon() { bool PreferAppIndicatorTrayIcon() {

View File

@ -32,6 +32,7 @@ enum class Type {
Unity, Unity,
XFCE, XFCE,
Pantheon, Pantheon,
Awesome,
}; };
Type Get(); Type Get();
@ -68,6 +69,10 @@ inline bool IsPantheon() {
return Get() == Type::Pantheon; return Get() == Type::Pantheon;
} }
inline bool IsAwesome() {
return Get() == Type::Awesome;
}
bool TryQtTrayIcon(); bool TryQtTrayIcon();
bool PreferAppIndicatorTrayIcon(); bool PreferAppIndicatorTrayIcon();
bool TryUnityCounter(); bool TryUnityCounter();