iOS: Don't claim that windows with zero width and/or height are exposed

When sending expose events to Qt, Qt will ask us if we're exposed,
and we need to tell it that we're not, so that clients will not try
to makeCurrent on a CA layer that has a zero width and/or height.

Note that this only works because we flush expose events.

Change-Id: Idfbe03a2f35681084061376a3c650a8da027fda4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
This commit is contained in:
Tor Arne Vestbø 2013-12-04 16:32:47 +01:00 committed by The Qt Project
parent ec03058fa5
commit 95822e28e2
2 changed files with 7 additions and 0 deletions

View File

@ -74,6 +74,8 @@ public:
void handleContentOrientationChange(Qt::ScreenOrientation orientation);
void setVisible(bool visible);
bool isExposed() const Q_DECL_OVERRIDE;
void raise() { raiseOrLower(true); }
void lower() { raiseOrLower(false); }
void requestActivateWindow();

View File

@ -579,6 +579,11 @@ void QIOSWindow::applyGeometry(const QRect &rect)
[m_view layoutIfNeeded];
}
bool QIOSWindow::isExposed() const
{
return window()->isVisible() && !window()->geometry().isEmpty();
}
void QIOSWindow::setWindowState(Qt::WindowState state)
{
// Update the QWindow representation straight away, so that