summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/ozone/gl_context_qt.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/ozone/gl_context_qt.cpp b/src/core/ozone/gl_context_qt.cpp
index 1dd7d8f6e..8f9093a4e 100644
--- a/src/core/ozone/gl_context_qt.cpp
+++ b/src/core/ozone/gl_context_qt.cpp
@@ -141,10 +141,12 @@ void* GLContextHelper::getEGLDisplay()
void* GLContextHelper::getXDisplay()
{
- QPlatformNativeInterface *pni = QGuiApplication::platformNativeInterface();
- if (pni)
- return pni->nativeResourceForScreen(QByteArrayLiteral("display"), qApp->primaryScreen());
+#if QT_CONFIG(xcb)
+ auto *x11app = qGuiApp->nativeInterface<QNativeInterface::QX11Application>();
+ return x11app ? x11app->display() : nullptr;
+#else
return nullptr;
+#endif
}
void* GLContextHelper::getNativeDisplay()