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>
This commit is contained in:
Laszlo Agocs 2013-10-01 11:38:40 +02:00 committed by The Qt Project
parent d8a489ccc2
commit 4e20df5fc5
2 changed files with 15 additions and 3 deletions

View File

@ -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;

View File

@ -58,6 +58,7 @@ public:
~QEglFSWindow();
void setGeometry(const QRect &);
QRect geometry() const;
WId winId() const;
void setVisible(bool visible);
void requestActivateWindow();