From f439108c4f6e456d329a666fe5000d07538b63c1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 20 Nov 2012 09:13:50 +0100 Subject: Detect Unity by checking XDG_CURRENT_DESKTOP and use Gnome theme. Fallback to Gtk for unknown desktops, which should be suitable for most cases like XFCE. Task-number: QTCREATORBUG-8254 Change-Id: Iaf9959f75852e03a83b5af7d0dead01ef657d678 Reviewed-by: Frederik Gladhorn --- src/platformsupport/services/genericunix/qgenericunixservices.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/platformsupport/services/genericunix/qgenericunixservices.cpp') 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"); -- cgit v1.2.3