Fix events being processed on application start
authorSimon Hausmann <simon.hausmann@digia.com>
Wed, 26 Sep 2012 12:15:39 +0000 (14:15 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 26 Sep 2012 17:54:19 +0000 (19:54 +0200)
commitc4e736cf9d0ff9cecfa03c1e6386957c7de706da
tree40fb086f84cab70f7ca850e8d0008c8f87cdb0b3
parentaad58ac87e371129ee61168effd9daa491b476ab
Fix events being processed on application start

Commit ef2efafcc6b28791df6258fa1c5d565090a9577a introduced a call to
QWindowSystemInterface::sendWindowSystemEvents() in
QGuiApplicationPrivate::init(), which in its implementation ends up calling
sendPostedEvents() before flushing and processing any pending (internal) window
system events.

This patch changes the call in init() to use
QWindowSystemInterface::flushWindowSystemEvents() instead, which is more gentle
in that regard.

The provided unit test verifies that no posted events are processed during the
execution of the QGuiApplication constructor while at the same time verifying
what the original changed tried to do: Allow a generic plugin to provide window
system specific defaults that are implemented using the event queue of
QWindowSystemInterface.

Task-number: QTBUG-26886

Change-Id: I129a907c00d947df60fe1a02efc67857580fce24
Reviewed-by: David Faure <faure@kde.org>
src/gui/kernel/qguiapplication.cpp
tests/auto/gui/kernel/qguiapplication/testplugin.json [new file with mode: 0644]
tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp