diff options
-rw-r--r-- | src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp | 7 | ||||
-rw-r--r-- | src/plugins/platforms/offscreen/qoffscreenintegration_x11.h | 9 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp index 3c2fdb1f0f..0bb19bc4f6 100644 --- a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp +++ b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp @@ -155,6 +155,13 @@ void *QOffscreenX11PlatformNativeInterface::nativeResourceForContext(const QByte } #endif +#if QT_CONFIG(xcb) +Display *QOffscreenX11PlatformNativeInterface::display() const +{ + return m_connection ? reinterpret_cast<Display *>(m_connection->display()) : nullptr; +} +#endif + QOffscreenX11Connection::QOffscreenX11Connection() { XInitThreads(); diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h index afd30d7b4b..35c91d47d8 100644 --- a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h +++ b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h @@ -47,6 +47,7 @@ #include <qscopedpointer.h> #include <qpa/qplatformopenglcontext.h> +#include <QtGui/qguiapplication.h> QT_BEGIN_NAMESPACE @@ -54,6 +55,9 @@ class QOffscreenX11Connection; class QOffscreenX11Info; class QOffscreenX11PlatformNativeInterface : public QOffscreenPlatformNativeInterface +#if QT_CONFIG(xcb) + , public QNativeInterface::QX11Application +#endif { public: QOffscreenX11PlatformNativeInterface(QOffscreenIntegration *integration); @@ -63,7 +67,10 @@ public: #if !defined(QT_NO_OPENGL) && QT_CONFIG(xcb_glx_plugin) void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override; #endif - +#if QT_CONFIG(xcb) + Display *display() const override; + xcb_connection_t *connection() const override { return nullptr; }; +#endif QScopedPointer<QOffscreenX11Connection> m_connection; }; |