diff --git a/plugins/qpa/nativeinterface.cpp b/plugins/qpa/nativeinterface.cpp index c3cb175994..fc7ab3b29f 100644 --- a/plugins/qpa/nativeinterface.cpp +++ b/plugins/qpa/nativeinterface.cpp @@ -79,5 +79,26 @@ void *NativeInterface::nativeResourceForWindow(const QByteArray &resource, QWind return nullptr; } +static void roundtrip() +{ + if (!waylandServer()) { + return; + } + auto c = waylandServer()->internalClientConection(); + if (!c) { + return; + } + c->flush(); + waylandServer()->dispatch(); +} + +QFunctionPointer NativeInterface::platformFunction(const QByteArray &function) const +{ + if (qstrcmp(function.toLower(), "roundtrip") == 0) { + return &roundtrip; + } + return nullptr; +} + } } diff --git a/plugins/qpa/nativeinterface.h b/plugins/qpa/nativeinterface.h index b36ee1bb35..4a9f8e3988 100644 --- a/plugins/qpa/nativeinterface.h +++ b/plugins/qpa/nativeinterface.h @@ -35,6 +35,7 @@ public: explicit NativeInterface(Integration *integration); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; + QFunctionPointer platformFunction(const QByteArray &function) const override; private: Integration *m_integration;