Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
Linux desktop, X11
-
c4e736cf9d0ff9cecfa03c1e6386957c7de706da
Description
In Qt5, creating a QApplication instance triggers event processing already, much before calling QApplication::exec().
This comes from QGuiApplicationPrivate::init() calling QWindowSystemInterface::sendWindowSystemEvents(), which calls
sendPostedEvent().
As a result, a DBus call to this application can get processed already, even if nothing is ready for it yet...
Simon Hausmann wrote:
The specific case of ef2efafcc6b28791df6258fa1c5d565090a9577a comes from the
MeeGo plugin that uses dbus properties to determine the screen orientation and sends a screen orientation change event on startup. Processing this window system even here helps to ensure that the initial screen orientation is correct.
It sounds like sendPostedEvents() without any parameters is indeed a little
bit too aggressive. Laszlo, Paul, any thoughts?
Unless perhaps QApplicationPrivate::init should call
QWindowSystemInterface::flushWindowSystemEvents instead?