Differential D22829 Diff 62793 patch/qtwayland-use-gnome-platform-theme-on-gnome-based-desktops.patch
Changeset View
Changeset View
Standalone View
Standalone View
patch/qtwayland-use-gnome-platform-theme-on-gnome-based-desktops.patch
- This file was added.
1 | diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp | ||||
---|---|---|---|---|---|
2 | index 97e0203c..5bee160a 100644 | ||||
3 | --- a/src/client/qwaylandintegration.cpp | ||||
4 | +++ b/src/client/qwaylandintegration.cpp | ||||
5 | @@ -99,20 +99,26 @@ public: | ||||
6 | | ||||
7 | if (QGuiApplication::desktopSettingsAware()) { | ||||
8 | const QByteArray desktopEnvironment = QGuiApplicationPrivate::platformIntegration()->services()->desktopEnvironment(); | ||||
9 | - | ||||
10 | + QList<QByteArray> gtkBasedEnvironments; | ||||
11 | + gtkBasedEnvironments << "GNOME" | ||||
12 | + << "X-CINNAMON" | ||||
13 | + << "UNITY" | ||||
14 | + << "MATE" | ||||
15 | + << "XFCE" | ||||
16 | + << "LXDE"; | ||||
17 | if (desktopEnvironment == QByteArrayLiteral("KDE")) { | ||||
18 | #if QT_CONFIG(settings) | ||||
19 | result.push_back(QStringLiteral("kde")); | ||||
20 | #endif | ||||
21 | - } else if (!desktopEnvironment.isEmpty() && | ||||
22 | - desktopEnvironment != QByteArrayLiteral("UNKNOWN") && | ||||
23 | - desktopEnvironment != QByteArrayLiteral("GNOME") && | ||||
24 | - desktopEnvironment != QByteArrayLiteral("UNITY") && | ||||
25 | - desktopEnvironment != QByteArrayLiteral("MATE") && | ||||
26 | - desktopEnvironment != QByteArrayLiteral("XFCE") && | ||||
27 | - desktopEnvironment != QByteArrayLiteral("LXDE")) | ||||
28 | + } else if (gtkBasedEnvironments.contains(desktopEnvironment)) { | ||||
29 | + // prefer the GTK3 theme implementation with native dialogs etc. | ||||
30 | + result.push_back(QStringLiteral("gtk3")); | ||||
31 | + // fallback to the generic Gnome theme if loading the GTK3 theme fails | ||||
32 | + result.push_back(QLatin1String(QGnomeTheme::name)); | ||||
33 | + } else if (!desktopEnvironment.isEmpty() && desktopEnvironment != QByteArrayLiteral("UNKNOWN")) { | ||||
34 | // Ignore X11 desktop environments | ||||
35 | result.push_back(QString::fromLocal8Bit(desktopEnvironment.toLower())); | ||||
36 | + } | ||||
37 | } | ||||
38 | | ||||
39 | if (result.isEmpty()) |