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 <victoria.fischer@mbition.io> Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2468>
This commit is contained in:
parent
f2be602266
commit
b018dd3204
2 changed files with 9 additions and 1 deletions
|
@ -23,6 +23,7 @@
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QtConcurrentRun>
|
#include <QtConcurrentRun>
|
||||||
|
|
||||||
|
#include <qpa/qplatformnativeinterface.h>
|
||||||
#include <qpa/qplatformwindow.h>
|
#include <qpa/qplatformwindow.h>
|
||||||
#include <qpa/qwindowsysteminterface.h>
|
#include <qpa/qwindowsysteminterface.h>
|
||||||
|
|
||||||
|
@ -47,6 +48,7 @@ Integration::Integration()
|
||||||
: QObject()
|
: QObject()
|
||||||
, QPlatformIntegration()
|
, QPlatformIntegration()
|
||||||
, m_fontDb(new QGenericUnixFontDatabase())
|
, m_fontDb(new QGenericUnixFontDatabase())
|
||||||
|
, m_nativeInterface(new QPlatformNativeInterface())
|
||||||
, m_services(new QGenericUnixServices())
|
, m_services(new QGenericUnixServices())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -198,6 +200,11 @@ void Integration::handleOutputDisabled(Output *output)
|
||||||
QWindowSystemInterface::handleScreenRemoved(platformScreen);
|
QWindowSystemInterface::handleScreenRemoved(platformScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPlatformNativeInterface *Integration::nativeInterface() const
|
||||||
|
{
|
||||||
|
return m_nativeInterface.data();
|
||||||
|
}
|
||||||
|
|
||||||
QPlatformServices *Integration::services() const
|
QPlatformServices *Integration::services() const
|
||||||
{
|
{
|
||||||
return m_services.data();
|
return m_services.data();
|
||||||
|
|
|
@ -46,6 +46,7 @@ public:
|
||||||
QStringList themeNames() const override;
|
QStringList themeNames() const override;
|
||||||
QPlatformTheme *createPlatformTheme(const QString &name) const override;
|
QPlatformTheme *createPlatformTheme(const QString &name) const override;
|
||||||
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
|
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
|
||||||
|
QPlatformNativeInterface *nativeInterface() const override;
|
||||||
QPlatformServices *services() const override;
|
QPlatformServices *services() const override;
|
||||||
void initialize() override;
|
void initialize() override;
|
||||||
|
|
||||||
|
@ -58,7 +59,7 @@ private Q_SLOTS:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<QPlatformFontDatabase> m_fontDb;
|
QScopedPointer<QPlatformFontDatabase> m_fontDb;
|
||||||
QPlatformNativeInterface *m_nativeInterface;
|
QScopedPointer<QPlatformNativeInterface> m_nativeInterface;
|
||||||
QPlatformPlaceholderScreen *m_dummyScreen = nullptr;
|
QPlatformPlaceholderScreen *m_dummyScreen = nullptr;
|
||||||
QHash<Output *, Screen *> m_screens;
|
QHash<Output *, Screen *> m_screens;
|
||||||
QScopedPointer<QGenericUnixServices> m_services;
|
QScopedPointer<QGenericUnixServices> m_services;
|
||||||
|
|
Loading…
Reference in a new issue