diff options
author | Erik Larsson <erik@ortogonal.com> | 2014-12-24 08:03:37 +0100 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2014-12-29 17:53:17 +0100 |
commit | 9a3674302c014800d53d1c0165a7876c75eacc9e (patch) | |
tree | 2ccf1cedfabacb91f05f04de965fd33cb919eeb4 /src | |
parent | b0b2b9c8f748a9e8d2e0c1ffbd6e09df5f385aeb (diff) |
Fix crash when running QtWayland compositor on xcb-egl.
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 <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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<QXcbEglWindow *>(window->handle())->glIntegration()->eglDisplay(); return Q_NULLPTR; } |