From a2ebad760fefe015c46e8bc649e38b6ecd6093bf Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sat, 12 Feb 2022 18:51:49 +0100 Subject: [PATCH] Implement services in our QPA This is required for QDesktopServices to work. Use QGenericUnixServices like the xcb and wayland QPA BUG: 446144 --- CMakeLists.txt | 1 + src/plugins/qpa/CMakeLists.txt | 1 + src/plugins/qpa/integration.cpp | 6 ++++++ src/plugins/qpa/integration.h | 3 +++ 4 files changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 818862cbf4..9c733813e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -281,6 +281,7 @@ set_package_properties(X11_XCB PROPERTIES # dependencies for QPA plugin find_package(Qt5FontDatabaseSupport REQUIRED) find_package(Qt5ThemeSupport REQUIRED) +find_package(Qt5ServiceSupport REQUIRED) find_package(Qt5EventDispatcherSupport REQUIRED) find_package(Freetype REQUIRED) diff --git a/src/plugins/qpa/CMakeLists.txt b/src/plugins/qpa/CMakeLists.txt index 952a5f5e91..d3de3a0d79 100644 --- a/src/plugins/qpa/CMakeLists.txt +++ b/src/plugins/qpa/CMakeLists.txt @@ -22,6 +22,7 @@ target_link_libraries(KWinQpaPlugin PRIVATE Qt::FontDatabaseSupportPrivate Qt::ThemeSupportPrivate Qt::EventDispatcherSupportPrivate + Qt::ServiceSupportPrivate Freetype::Freetype # Must be after Qt5 platform support libs Fontconfig::Fontconfig kwin diff --git a/src/plugins/qpa/integration.cpp b/src/plugins/qpa/integration.cpp index 8bb19731f8..55a75ea93e 100644 --- a/src/plugins/qpa/integration.cpp +++ b/src/plugins/qpa/integration.cpp @@ -40,6 +40,7 @@ Integration::Integration() : QObject() , QPlatformIntegration() , m_fontDb(new QGenericUnixFontDatabase()) + , m_services(new QGenericUnixServices()) { } @@ -190,5 +191,10 @@ void Integration::handleOutputDisabled(AbstractOutput *output) QWindowSystemInterface::handleScreenRemoved(platformScreen); } +QPlatformServices *Integration::services() const +{ + return m_services.data(); +} + } } diff --git a/src/plugins/qpa/integration.h b/src/plugins/qpa/integration.h index 7f7a337b57..c333e6bf59 100644 --- a/src/plugins/qpa/integration.h +++ b/src/plugins/qpa/integration.h @@ -13,6 +13,7 @@ #include #include +#include #include namespace KWin @@ -41,6 +42,7 @@ public: QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; + QPlatformServices *services() const override; void initialize() override; QHash screens() const; @@ -55,6 +57,7 @@ private: QPlatformNativeInterface *m_nativeInterface; QPlatformPlaceholderScreen *m_dummyScreen = nullptr; QHash m_screens; + QScopedPointer m_services; }; }