summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/services/genericunix/qgenericunixservices.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport/services/genericunix/qgenericunixservices.cpp')
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
index f6bf8608d16..7d0145e61d9 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp
+++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
@@ -56,6 +56,10 @@ static inline QByteArray detectDesktopEnvironment()
{
if (!qEnvironmentVariableIsEmpty("KDE_FULL_SESSION"))
return QByteArray("KDE");
+ // Check Unity first, whose older versions also have "GNOME_DESKTOP_SESSION_ID" set.
+ const QByteArray xdgCurrentDesktop = qgetenv("XDG_CURRENT_DESKTOP");
+ if (xdgCurrentDesktop == "Unity")
+ return QByteArrayLiteral("UNITY");
// GNOME_DESKTOP_SESSION_ID is deprecated for some reason, but still check it
if (qgetenv("DESKTOP_SESSION") == "gnome" || !qEnvironmentVariableIsEmpty("GNOME_DESKTOP_SESSION_ID"))
return QByteArray("GNOME");