qt5base-lts/tests/auto/gui
Alex Trotsenko 81408c0e76 QEventDispatcherWin32: avoid livelock in a foreign event loop
According to Windows docs, GetMessage() function retrieves the messages
from the input queue in defined order, where posted messages are
processed ahead of input messages, even if they were posted later.
Therefore, if the application produces a posted event permanently, as
a result of processing that event, user input messages may be blocked
due to hard CPU usage by the application.

It's not a problem, if an internal Qt event loop is running. By calling
sendPostedEvents() on the beginning of processEvents(), we are sending
posted events only once per iteration. However, during execution of
the foreign loop, we should artificially lower the priority of the
WM_QT_SENDPOSTEDEVENTS message in order to enable delivery of other
input messages.

To solve the problem, it is proposed to postpone the
WM_QT_SENDPOSTEDEVENTS message until the message queue becomes empty,
as it works for the internal loop.

Task-number: QTBUG-77464
Change-Id: I8dedb6837c6fc41aa6f497e67ab2352c2b4f3772
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-08-29 09:12:29 +00:00
..
image Merge remote-tracking branch 'origin/dev' into 5.14 2019-08-27 09:45:52 +02:00
itemmodels Remove usages of deprecated APIs of corelib 2019-07-05 11:25:46 +02:00
kernel QEventDispatcherWin32: avoid livelock in a foreign event loop 2019-08-29 09:12:29 +00:00
math3d Remove usages of deprecated APIs of qtbase/gui 2019-07-13 10:43:15 +02:00
painting Merge remote-tracking branch 'origin/dev' into 5.14 2019-08-27 09:45:52 +02:00
qopengl unblacklist passing tests 2019-07-08 11:01:42 +00:00
qopenglconfig Deprecate conversion functions between QList and QSet 2019-05-07 14:15:44 +00:00
qvulkan Merge remote-tracking branch 'origin/5.10' into dev 2017-10-17 10:34:24 +02:00
rhi Introduce the Qt graphics abstraction as private QtGui helpers 2019-06-13 10:13:45 +02:00
text QTextDocument: add css-styling of table cell borders to HTML import/export 2019-08-19 20:59:12 +02:00
util Remove usages of deprecated APIs of qtbase/gui 2019-07-13 10:43:15 +02:00
gui.pro Introduce the Qt graphics abstraction as private QtGui helpers 2019-06-13 10:13:45 +02:00