summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfswindow.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2013-10-01 11:38:40 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-01 12:58:17 +0200
commit4e20df5fc5bffa661ae44255d9a194cc6e8cf290 (patch)
treeeddb6a66090f2383bd78134d3cfc1c4fad9ce990 /src/plugins/platforms/eglfs/qeglfswindow.cpp
parentd8a489ccc25fa86825eb1c5ad91669c26153cb18 (diff)
eglfs: Make QML root objects sized to view working again
The size is queried from the window before create() is called. Therefore Quick apps were not covering the entire screen as they should. This is now fixed by properly returning the fullscreen geometry from QEglFSWindow::geometry() even when create() has not yet been called. Pre-5.2 this was working because the QEglFSWindow constructor changed the window state. This is not feasible anymore with the recent compositing changes since the second, third, etc. windows are not fullscreen. Task-number: QTBUG-33620 Change-Id: If66d35f6f4768485d4e68c5ad825fe7a9d948a64 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfswindow.cpp')
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index ac2e7e72fb..17ab68f747 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -114,8 +114,9 @@ void QEglFSWindow::create()
}
window()->setSurfaceType(QSurface::OpenGLSurface);
- setGeometry(screen()->availableGeometry());
- QWindowSystemInterface::handleExposeEvent(window(), QRegion(screen()->availableGeometry()));
+ m_flags |= HasNativeWindow;
+ setGeometry(QRect()); // will become fullscreen
+ QWindowSystemInterface::handleExposeEvent(window(), geometry());
EGLDisplay display = static_cast<QEglFSScreen *>(screen())->display();
QSurfaceFormat platformFormat = QEglFSHooks::hooks()->surfaceFormatFor(window()->requestedFormat());
@@ -124,7 +125,6 @@ void QEglFSWindow::create()
resetSurface();
- m_flags |= HasNativeWindow;
if (screen()->primarySurface() == EGL_NO_SURFACE) {
screen()->setPrimarySurface(m_surface);
m_flags |= IsRasterRoot;
@@ -212,6 +212,17 @@ void QEglFSWindow::setGeometry(const QRect &r)
QWindowSystemInterface::handleGeometryChange(window(), rect);
}
+QRect QEglFSWindow::geometry() const
+{
+ // For yet-to-become-fullscreen windows report the geometry covering the entire
+ // screen. This is particularly important for Quick where the root object may get
+ // sized to some geometry queried before calling create().
+ if (!m_flags.testFlag(Created) && screen()->primarySurface() == EGL_NO_SURFACE)
+ return screen()->availableGeometry();
+
+ return QPlatformWindow::geometry();
+}
+
WId QEglFSWindow::winId() const
{
return m_wid;