summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2013-09-11 18:53:02 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-13 09:22:13 +0200
commita26f47756be60348ec1fff1402163356e9f6b059 (patch)
tree2093bc3e99f7ac68292504a2e2c47f267014af87
parent348b641fee1def119ab396422a4ec2a517720c34 (diff)
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>
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index bf6e375ac0..73f52f0796 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -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);
}