summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorMorten Sorvig <morten.sorvig@nokia.com>2011-08-23 12:51:11 +0200
committerGunnar Sletta <gunnar.sletta@nokia.com>2011-08-31 16:16:03 +0200
commit071914232189735ae6475d44d07f11f90b4729a1 (patch)
treef749a96da620f6a4e9de74fbd09aa4d6c5d0adf1 /src/gui
parent090ee21eac7257644422e35395194e5fd7fb8efa (diff)
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 <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.cpp4
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
index d6f94b6261..d862d05baa 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
@@ -276,10 +276,10 @@ void QWindowSystemInterface::handleUnmapEvent(QWindow *tlw)
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
}
-void QWindowSystemInterface::handleExposeEvent(QWindow *tlw, const QRegion &region)
+void QWindowSystemInterface::handleSynchronousExposeEvent(QWindow *tlw, const QRegion &region)
{
QWindowSystemInterfacePrivate::ExposeEvent *e = new QWindowSystemInterfacePrivate::ExposeEvent(tlw, region);
- QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
+ QGuiApplicationPrivate::processWindowSystemEvent(e); // send event immediately.
}
bool QWindowSystemInterface::sendWindowSystemEvents(QAbstractEventDispatcher *eventDispatcher, QEventLoop::ProcessEventsFlags flags)
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.h b/src/gui/kernel/qwindowsysteminterface_qpa.h
index 2f3f8a171e..99db5f2b17 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.h
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.h
@@ -105,7 +105,7 @@ public:
static void handleMapEvent(QWindow *w);
static void handleUnmapEvent(QWindow *w);
- static void handleExposeEvent(QWindow *w, const QRegion &region);
+ static void handleSynchronousExposeEvent(QWindow *tlw, const QRegion &region);
// Drag and drop. These events are sent immediately.
static Qt::DropAction handleDrag(QWindow *w, QMimeData *dropData, const QPoint &p);