From: Morten Sorvig Date: Tue, 23 Aug 2011 10:51:11 +0000 (+0200) Subject: Cocoa: Fix qmlscene flicker on startup. X-Git-Tag: qt-v5.0.0-alpha1~222^2^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=123e90b5b97587b0005136316adc8e3f3603ca34;p=profile%2Fivi%2Fqtwayland.git Cocoa: Fix qmlscene flicker on startup. The SG render thread was racing window creation in the GUI thread, which would cause flicker if the window won the race and was shown before the SG thread had a frame ready. Send a synchronous expose event before showing the window - this will wait for the SG render thread. In addition, don't defer NSwindow creation. The GL context setup is done before the window is shown and needs a fully created window. New API: QWindowSystemInterface::handleSynchronousExposeEvent Retire: QWindowSystemInterface::handleExposeEvent Change-Id: I0bb46089d16ec4882aaac8db67b57d15e0f51531 Reviewed-on: http://codereview.qt.nokia.com/3399 Reviewed-by: Qt Sanity Bot Reviewed-by: Gunnar Sletta Reviewed-by: Richard Moe Gustavsen --- diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index f685dae..48da7b5 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -125,7 +125,7 @@ void QWaylandWindow::attach(QWaylandBuffer *buffer) mBuffer = buffer; if (mSurface) { wl_surface_attach(mSurface, buffer->buffer(),0,0); - QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size())); + QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRect(QPoint(), geometry().size())); } }