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:
parent
d8a489ccc2
commit
4e20df5fc5
@ -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;
|
||||
|
@ -58,6 +58,7 @@ public:
|
||||
~QEglFSWindow();
|
||||
|
||||
void setGeometry(const QRect &);
|
||||
QRect geometry() const;
|
||||
WId winId() const;
|
||||
void setVisible(bool visible);
|
||||
void requestActivateWindow();
|
||||
|
Loading…
Reference in New Issue
Block a user