diff options
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r-- | src/client/qwaylandwindow.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 215193a7b..c0a415725 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -26,6 +26,7 @@ #include <QGuiApplication> #include <qpa/qwindowsysteminterface.h> +#include <QtGui/private/qguiapplication_p.h> #include <QtGui/private/qwindow_p.h> #include <QtCore/QDebug> @@ -36,6 +37,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + namespace QtWaylandClient { Q_LOGGING_CATEGORY(lcWaylandBackingstore, "qt.qpa.wayland.backingstore") @@ -1092,6 +1095,22 @@ bool QWaylandWindow::createDecoration() } } + if (targetKey.isEmpty()) { + auto unixServices = dynamic_cast<QGenericUnixServices *>( + QGuiApplicationPrivate::platformIntegration()->services()); + const QByteArray currentDesktop = unixServices->desktopEnvironment(); + if (currentDesktop == "GNOME") { + if (decorations.contains("adwaita"_L1)) + targetKey = "adwaita"_L1; + else if (decorations.contains("gnome"_L1)) + targetKey = "gnome"_L1; + } else { + // Do not use Adwaita/GNOME decorations on other DEs + decorations.removeAll("adwaita"_L1); + decorations.removeAll("gnome"_L1); + } + } + if (targetKey.isEmpty()) targetKey = decorations.first(); // first come, first served. |