diff options
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformintegration.cpp | 23 | ||||
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformintegration_p.h | 1 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp index 820c433a2c..3de0642c93 100644 --- a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp @@ -190,7 +190,8 @@ enum ResourceType { EglDisplay, EglWindow, EglContext, - NativeDisplay + NativeDisplay, + Display }; static int resourceType(const QByteArray &key) @@ -199,7 +200,8 @@ static int resourceType(const QByteArray &key) QByteArrayLiteral("egldisplay"), QByteArrayLiteral("eglwindow"), QByteArrayLiteral("eglcontext"), - QByteArrayLiteral("nativedisplay") + QByteArrayLiteral("nativedisplay"), + QByteArrayLiteral("display") }; const QByteArray *end = names + sizeof(names) / sizeof(names[0]); const QByteArray *result = std::find(names, end, key); @@ -226,6 +228,23 @@ void *QEGLPlatformIntegration::nativeResourceForIntegration(const QByteArray &re return result; } +void *QEGLPlatformIntegration::nativeResourceForScreen(const QByteArray &resource, QScreen *) +{ + void *result = 0; + + switch (resourceType(resource)) { + case Display: + // Play nice when using the x11 hooks: Be compatible with xcb that allows querying + // the X Display pointer, which is nothing but our native display. + result = reinterpret_cast<void*>(nativeDisplay()); + break; + default: + break; + } + + return result; +} + void *QEGLPlatformIntegration::nativeResourceForWindow(const QByteArray &resource, QWindow *window) { void *result = 0; diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h index f665455383..0de8cc9a33 100644 --- a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h +++ b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h @@ -79,6 +79,7 @@ public: QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE; // QPlatformNativeInterface void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; + void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) Q_DECL_OVERRIDE; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; |