From 4e20df5fc5bffa661ae44255d9a194cc6e8cf290 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 1 Oct 2013 11:38:40 +0200 Subject: 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 --- src/plugins/platforms/eglfs/qeglfswindow.cpp | 17 ++++++++++++++--- src/plugins/platforms/eglfs/qeglfswindow.h | 1 + 2 files changed, 15 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(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; diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h index a5a25409b2..71c0ed5c27 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.h +++ b/src/plugins/platforms/eglfs/qeglfswindow.h @@ -58,6 +58,7 @@ public: ~QEglFSWindow(); void setGeometry(const QRect &); + QRect geometry() const; WId winId() const; void setVisible(bool visible); void requestActivateWindow(); -- cgit v1.2.3