User input events will be queued if processEvents()
is called with the ExcludeUserInputEvents flag. User
code then expect that the queued events will be sent
when the corresponding exec() call returns.
We were sending queued user input event at the beginning
of processEvents(). However, the cocoa event dispatcher
also has a mode where it makes a blocking call to
[NSApp run], in which case processEvents() never returns
during event processing. This means we don’t get to call
the queued-event-sending code.
Factor out the queued-event-sending code to a new
sendQueuedUserInputEvents() function. Call it from
postedEventsSourceCallback() to make sure the queue
is emptied after the ExcludeUserInputEvents processEvents()
call is done.
Task-number: QTBUG-69687
Change-Id: I4ff554ef4d39a69356736c33a650886b56bfdb4c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>