From b018dd32045cf3f9dc36fab6867788a0c8604448 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Wed, 25 May 2022 13:06:47 +0200 Subject: [PATCH] qpa: Provide a QPlatformNativeInterface Under Gnome/Unity/XFCE, but not Plasma(!), QFontconfigDatabase queries the platform native interface for certain font settings (e.g. antialiasingEnabled). Without a QPNI this would crash KWin as soon as it tried to query for fonts. Signed-off-by: Victoria Fischer Part-of: --- src/plugins/qpa/integration.cpp | 7 +++++++ src/plugins/qpa/integration.h | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/qpa/integration.cpp b/src/plugins/qpa/integration.cpp index 5880a2f92d..675fe9d180 100644 --- a/src/plugins/qpa/integration.cpp +++ b/src/plugins/qpa/integration.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -47,6 +48,7 @@ Integration::Integration() : QObject() , QPlatformIntegration() , m_fontDb(new QGenericUnixFontDatabase()) + , m_nativeInterface(new QPlatformNativeInterface()) , m_services(new QGenericUnixServices()) { } @@ -198,6 +200,11 @@ void Integration::handleOutputDisabled(Output *output) QWindowSystemInterface::handleScreenRemoved(platformScreen); } +QPlatformNativeInterface *Integration::nativeInterface() const +{ + return m_nativeInterface.data(); +} + QPlatformServices *Integration::services() const { return m_services.data(); diff --git a/src/plugins/qpa/integration.h b/src/plugins/qpa/integration.h index 6f8268b9c8..bb027a67cd 100644 --- a/src/plugins/qpa/integration.h +++ b/src/plugins/qpa/integration.h @@ -46,6 +46,7 @@ public: QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; + QPlatformNativeInterface *nativeInterface() const override; QPlatformServices *services() const override; void initialize() override; @@ -58,7 +59,7 @@ private Q_SLOTS: private: QScopedPointer m_fontDb; - QPlatformNativeInterface *m_nativeInterface; + QScopedPointer m_nativeInterface; QPlatformPlaceholderScreen *m_dummyScreen = nullptr; QHash m_screens; QScopedPointer m_services;