eglfs: Handle desktop and multiple windows gracefully

When trying to create more than one window, stop with a helpful error
message since this is not yet supported. Also, return a fake WId for
desktop windows.

Change-Id: I9859b62b1d4f6b6142982d2e5a90afc1fc3c6a28
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
This commit is contained in:
Laszlo Agocs 2013-09-11 18:53:02 +02:00 committed by The Qt Project
parent 348b641fee
commit a26f47756b

View File

@ -87,8 +87,10 @@ void QEglFSWindow::create()
return;
}
if (!supportsMultipleWindows() && screen()->primarySurface())
if (!supportsMultipleWindows() && screen()->primarySurface()) {
qFatal("EGLFS: Multiple windows are not supported");
return;
}
EGLDisplay display = (static_cast<QEglFSScreen *>(window()->screen()->handle()))->display();
QSurfaceFormat platformFormat = QEglFSHooks::hooks()->surfaceFormatFor(window()->requestedFormat());
@ -161,6 +163,10 @@ void QEglFSWindow::setWindowState(Qt::WindowState)
WId QEglFSWindow::winId() const
{
// Return a fake WId for desktop windows.
if (window()->type() == Qt::Desktop)
return std::numeric_limits<WId>::max();
return WId(m_window);
}