iOS: Document why we're using a runloop mode tracker in our event dispatcher

Change-Id: I71093ca05988c3e1ad6d51be7363952dd3f0518e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
bb10
Tor Arne Vestbø 2018-04-20 16:02:17 +02:00 committed by Simon Hausmann
parent 46ec170d2b
commit 79d900bee4
1 changed files with 18 additions and 0 deletions

View File

@ -58,6 +58,24 @@
QT_USE_NAMESPACE
/*!
During scroll view panning, and possibly other gestures, UIKit will
request a switch to UITrackingRunLoopMode via GSEventPushRunLoopMode,
which records the new runloop mode and stops the current runloop.
Unfortunately the runloop mode is just stored on an internal stack, used
when UIKit itself is running the runloop, and is not available through e.g.
CFRunLoopCopyCurrentMode, which only knows about the current running
runloop mode, not the requested future runloop mode.
To ensure that we pick up this new runloop mode and use it when calling
CFRunLoopRunInMode from processEvents, we listen for the notification
emitted by [UIApplication pushRunLoopMode:requester:].
Without this workaround we end up always running in the default runloop
mode, resulting in missing momentum-phases in UIScrollViews such as the
emoji keyboard.
*/
@interface QT_MANGLE_NAMESPACE(RunLoopModeTracker) : NSObject
@end