From 9a3674302c014800d53d1c0165a7876c75eacc9e Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Wed, 24 Dec 2014 08:03:37 +0100 Subject: Fix crash when running QtWayland compositor on xcb-egl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running the compositor on xcb the compositor backend will call nativeResourceForWindow with EglDisplay as resource. When this is done the window->handle() will be null and result in a crash. By returning just the eglDisplay() when the window->handle() is null solves the problem and also makes the compositor work. Change-Id: I72f4341402facc8c44a41151c4f76d6447bd8070 Reviewed-by: Jørgen Lind --- .../xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp index e65a7bb085..9d06502158 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp @@ -116,8 +116,9 @@ void *QXcbEglNativeInterfaceHandler::eglDisplay() void *QXcbEglNativeInterfaceHandler::eglDisplayForWindow(QWindow *window) { Q_ASSERT(window); - Q_ASSERT(window->handle()); - if (window->supportsOpenGL()) + if (window->supportsOpenGL() && window->handle() == Q_NULLPTR) + return eglDisplay(); + else if (window->supportsOpenGL()) return static_cast(window->handle())->glIntegration()->eglDisplay(); return Q_NULLPTR; } -- cgit v1.2.3