From 851b39a6d675552e2fc70c75652ffc04bcc1a2ed Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 16 Apr 2017 09:52:44 -0700 Subject: Update detection of $DESKTOP_SESSION I don't know how widespread this use is, but apparently sddm seems to set DESKTOP_SESSION to be the .desktop file that it used to launch the session (minus the .desktop extension). In that case, we should read the DesktopName entry from the file to get the actual desktop type. And since the desktop detection from QGenericUnixServices should suffice, we don't need to repeat the same code in QGenericUnixThemes. Change-Id: I0e1a09998253489388abfffd14b5eeefbd7fe740 Reviewed-by: J-P Nurmi --- src/platformsupport/themes/genericunix/qgenericunixthemes.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/platformsupport/themes') diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index e9116223bd..8dfae2ca0b 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -824,11 +824,13 @@ QStringList QGenericUnixTheme::themeNames() result.push_back(QStringLiteral("gtk3")); // fallback to the generic Gnome theme if loading the GTK3 theme fails result.push_back(QLatin1String(QGnomeTheme::name)); + } else { + // unknown, but lowercase the name (our standard practice) and + // remove any "x-" prefix + QString s = QString::fromLatin1(desktopName.toLower()); + result.push_back(s.startsWith(QLatin1String("x-")) ? s.mid(2) : s); } } - const QString session = QString::fromLocal8Bit(qgetenv("DESKTOP_SESSION")); - if (!session.isEmpty() && session != QLatin1String("default") && !result.contains(session)) - result.push_back(session); } // desktopSettingsAware result.append(QLatin1String(QGenericUnixTheme::name)); return result; -- cgit v1.2.3