Commit b018dd32 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik Committed by Merge Service
Browse files

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: default avatarVictoria Fischer <victoria.fischer@mbition.io>
Part-of: <!2468>
parent f2be6022
Pipeline #180832 passed with stage
in 12 minutes and 31 seconds
......@@ -23,6 +23,7 @@
#include <QCoreApplication>
#include <QtConcurrentRun>
#include <qpa/qplatformnativeinterface.h>
#include <qpa/qplatformwindow.h>
#include <qpa/qwindowsysteminterface.h>
......@@ -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();
......
......@@ -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<QPlatformFontDatabase> m_fontDb;
QPlatformNativeInterface *m_nativeInterface;
QScopedPointer<QPlatformNativeInterface> m_nativeInterface;
QPlatformPlaceholderScreen *m_dummyScreen = nullptr;
QHash<Output *, Screen *> m_screens;
QScopedPointer<QGenericUnixServices> m_services;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment