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>
This commit is contained in:
parent
b0b2b9c8f7
commit
9a3674302c
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user