Don’t flicker on startup: render on expose

All QWindow implementations must produce a frame before
returning from the expose event.

Change-Id: I5640809c47e948101879c1623c12230fa0a63c44
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Morten Johan Sørvig 2016-08-23 08:02:16 +02:00 committed by Tor Arne Vestbø
parent 6ca65dd97d
commit 24961cb18c
2 changed files with 3 additions and 1 deletions

View File

@ -93,6 +93,8 @@ HelloWindow::HelloWindow(const QSharedPointer<Renderer> &renderer, QScreen *scre
void HelloWindow::exposeEvent(QExposeEvent *) void HelloWindow::exposeEvent(QExposeEvent *)
{ {
m_renderer->setAnimating(this, isExposed()); m_renderer->setAnimating(this, isExposed());
if (isExposed())
m_renderer->render();
} }
void HelloWindow::mousePressEvent(QMouseEvent *) void HelloWindow::mousePressEvent(QMouseEvent *)

View File

@ -70,7 +70,7 @@ public:
void setAnimating(HelloWindow *window, bool animating); void setAnimating(HelloWindow *window, bool animating);
private slots: public slots:
void render(); void render();
private: private: