Implement services in our QPA

This is required for QDesktopServices to work.

Use QGenericUnixServices like the xcb and wayland QPA

BUG: 446144
This commit is contained in:
Nicolas Fella 2022-02-12 18:51:49 +01:00
parent 77ec43d5e1
commit a2ebad760f
4 changed files with 11 additions and 0 deletions

View file

@ -281,6 +281,7 @@ set_package_properties(X11_XCB PROPERTIES
# dependencies for QPA plugin # dependencies for QPA plugin
find_package(Qt5FontDatabaseSupport REQUIRED) find_package(Qt5FontDatabaseSupport REQUIRED)
find_package(Qt5ThemeSupport REQUIRED) find_package(Qt5ThemeSupport REQUIRED)
find_package(Qt5ServiceSupport REQUIRED)
find_package(Qt5EventDispatcherSupport REQUIRED) find_package(Qt5EventDispatcherSupport REQUIRED)
find_package(Freetype REQUIRED) find_package(Freetype REQUIRED)

View file

@ -22,6 +22,7 @@ target_link_libraries(KWinQpaPlugin PRIVATE
Qt::FontDatabaseSupportPrivate Qt::FontDatabaseSupportPrivate
Qt::ThemeSupportPrivate Qt::ThemeSupportPrivate
Qt::EventDispatcherSupportPrivate Qt::EventDispatcherSupportPrivate
Qt::ServiceSupportPrivate
Freetype::Freetype # Must be after Qt5 platform support libs Freetype::Freetype # Must be after Qt5 platform support libs
Fontconfig::Fontconfig Fontconfig::Fontconfig
kwin kwin

View file

@ -40,6 +40,7 @@ Integration::Integration()
: QObject() : QObject()
, QPlatformIntegration() , QPlatformIntegration()
, m_fontDb(new QGenericUnixFontDatabase()) , m_fontDb(new QGenericUnixFontDatabase())
, m_services(new QGenericUnixServices())
{ {
} }
@ -190,5 +191,10 @@ void Integration::handleOutputDisabled(AbstractOutput *output)
QWindowSystemInterface::handleScreenRemoved(platformScreen); QWindowSystemInterface::handleScreenRemoved(platformScreen);
} }
QPlatformServices *Integration::services() const
{
return m_services.data();
}
} }
} }

View file

@ -13,6 +13,7 @@
#include <epoxy/egl.h> #include <epoxy/egl.h>
#include <qpa/qplatformintegration.h> #include <qpa/qplatformintegration.h>
#include <QtServiceSupport/private/qgenericunixservices_p.h>
#include <QObject> #include <QObject>
namespace KWin namespace KWin
@ -41,6 +42,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;
QPlatformServices *services() const override;
void initialize() override; void initialize() override;
QHash<AbstractOutput *, Screen *> screens() const; QHash<AbstractOutput *, Screen *> screens() const;
@ -55,6 +57,7 @@ private:
QPlatformNativeInterface *m_nativeInterface; QPlatformNativeInterface *m_nativeInterface;
QPlatformPlaceholderScreen *m_dummyScreen = nullptr; QPlatformPlaceholderScreen *m_dummyScreen = nullptr;
QHash<AbstractOutput *, Screen *> m_screens; QHash<AbstractOutput *, Screen *> m_screens;
QScopedPointer<QGenericUnixServices> m_services;
}; };
} }