Fix desktop detection via XDG_CURRENT_DESKTOP - check for colon

separated values.
This commit is contained in:
Craig Drummond
2017-08-15 12:34:08 +01:00
parent 93f5e89dd5
commit 93722d5cfd
2 changed files with 7 additions and 4 deletions

View File

@@ -8,6 +8,8 @@
5. Remove unity menu icon work-around.
6. To support alder GNOME settings daemon installations, revert to the
previous MediaKeys DBUS interface.
7. Fix desktop detection via XDG_CURRENT_DESKTOP - check for colon separated
values.
2.1.0
-----

View File

@@ -35,6 +35,7 @@
#include <QDesktopWidget>
#include <QEventLoop>
#include <QStandardPaths>
#include <QSet>
#ifndef _MSC_VER
#include <unistd.h>
#include <utime.h>
@@ -891,12 +892,12 @@ Utils::Desktop Utils::currentDe()
static int de=-1;
if (-1==de) {
de=Other;
QByteArray desktop=qgetenv("XDG_CURRENT_DESKTOP").toLower();
if ("unity"==desktop) {
QSet<QByteArray> desktop=qgetenv("XDG_CURRENT_DESKTOP").toLower().split(':').toSet();
if (desktop.contains("unity")) {
de=Unity;
} else if ("kde"==desktop) {
} else if (desktop.contains("kde")) {
de=KDE;
} else if ("gnome"==desktop || "pantheon"==desktop) {
} else if (desktop.contains("gnome") || desktop.contains("pantheon")) {
de=Gnome;
} else {
QByteArray kde=qgetenv("KDE_FULL_SESSION");