提交 6a1f9265 编写于 作者: C CyrusNajmabadi

Always delay until the next UI operation before classifying.

上级 bc246c76
...@@ -123,17 +123,15 @@ private sealed partial class TagSource : ForegroundThreadAffinitizedObject ...@@ -123,17 +123,15 @@ private sealed partial class TagSource : ForegroundThreadAffinitizedObject
// in. That way we can get the initial set of results for the buffer as quickly as // in. That way we can get the initial set of results for the buffer as quickly as
// possible, without kicking the work down the road. // possible, without kicking the work down the road.
var initialTagsCancellationToken = _initialComputationCancellationTokenSource.Token; var initialTagsCancellationToken = _initialComputationCancellationTokenSource.Token;
if (_workQueue.IsForeground())
{ // Note: we always kick this off to the new UI pump instead of computing tags right
RecomputeTagsForeground(cancellationTokenOpt: initialTagsCancellationToken); // on this thread. The reason for that is that we may be getting created at a time
} // when the view itself is initializing. As such the view is not in a state where
else // we want code touching it.
{ RegisterNotification(
RegisterNotification( () => RecomputeTagsForeground(cancellationTokenOpt: initialTagsCancellationToken),
() => RecomputeTagsForeground(cancellationTokenOpt: initialTagsCancellationToken), delay: 0,
delay: 0, cancellationToken: initialTagsCancellationToken);
cancellationToken: initialTagsCancellationToken);
}
} }
private ITaggerEventSource CreateEventSource() private ITaggerEventSource CreateEventSource()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册