Browse Source
* Use 0.2 seconds for input starvation cutoff. 1 second was too long when running on resource-constrained devices. * Allow input starvation code to run. Using `ScheduleRender(true)` here prevented the input starvation code from running. * Add DispatcherOptions. And allow setting the input starvation timeout there.pull/15451/head
committed by
GitHub
3 changed files with 32 additions and 4 deletions
@ -0,0 +1,21 @@ |
|||
using System; |
|||
|
|||
namespace Avalonia.Threading; |
|||
|
|||
/// <summary>
|
|||
/// AppBuilder options for configuring the <see cref="Dispatcher"/>.
|
|||
/// </summary>
|
|||
public class DispatcherOptions |
|||
{ |
|||
/// <summary>
|
|||
/// Gets or sets a timeout after which the dispatcher will start prioritizing input events over
|
|||
/// rendering. The default value is 1 second.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// If no input events are processed within this time, the dispatcher will start prioritizing
|
|||
/// input events over rendering to prevent the application from becoming unresponsive. This may
|
|||
/// need to be lowered on resource-constrained platforms where input events are processed on
|
|||
/// the same thread as rendering.
|
|||
/// </remarks>
|
|||
public TimeSpan InputStarvationTimeout { get; set; } = TimeSpan.FromSeconds(1); |
|||
} |
|||
Loading…
Reference in new issue