diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-12-02 14:08:29 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-12-05 14:08:09 +0100 |
commit | c7fec68e1936576070d0fbac6cf40b818366d298 (patch) | |
tree | cac9c960dfe98c28a680d6c756f539c155ecbdb5 /src/plugins/platforms/xcb | |
parent | aa504fc2fa764b44d37d9629b9ddf1f114210759 (diff) |
Do not read Xft.dpi on platforms that shouldn't be using Xft settings
We only read this for desktop environments that have traditionally used
these to set settings for other toolkits.
Fixes: QTBUG-80323
Change-Id: Ifa8c2682301e69c2770d3734115080a0e6b4e85c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscreen.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index 8da299d491..7c60ca06f9 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -41,6 +41,7 @@ #include "qxcbwindow.h" #include "qxcbcursor.h" #include "qxcbimage.h" +#include "qxcbintegration.h" #include "qnamespace.h" #include "qxcbxsettings.h" @@ -49,6 +50,7 @@ #include <QDebug> #include <QtAlgorithms> +#include <qpa/qplatformservices.h> #include <qpa/qwindowsysteminterface.h> #include <private/qmath_p.h> #include <QtGui/private/qhighdpiscaling_p.h> @@ -356,6 +358,15 @@ static QFontEngine::SubpixelAntialiasingType parseXftRgba(const QByteArray& stri void QXcbVirtualDesktop::readXResources() { + const QPlatformServices *services = QXcbIntegration::instance()->services(); + bool useXftConf = false; + if (services) { + const QList<QByteArray> desktopEnv = services->desktopEnvironment().split(':'); + useXftConf = desktopEnv.contains("GNOME") || desktopEnv.contains("UNITY") || desktopEnv.contains("XFCE"); + } + if (!useXftConf) + return; + int offset = 0; QByteArray resources; while (true) { |