Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix input starvation issues on resource-constrained devices. #15137

Merged
merged 3 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Avalonia.Base/Media/MediaContext.Compositor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,6 @@ void ICompositorScheduler.CommitRequested(Compositor compositor)
return;

// TODO: maybe skip the full render here?
ScheduleRender(true);
ScheduleRender(false);
}
}
2 changes: 1 addition & 1 deletion src/Avalonia.Base/Media/MediaContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal partial class MediaContext : ICompositorScheduler
private TimeSpan _inputMarkerAddedAt;
private bool _isRendering;
private bool _animationsAreWaitingForComposition;
private const double MaxSecondsWithoutInput = 1;
private const double MaxSecondsWithoutInput = 0.2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably make it configurable, otherwise we'll risk running into issues with XPF too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any preference as to where this configuration should be placed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need a separate options class. DispatcherOptions, maybe?

We should also consider runtimeconfig.json-based settings at some point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Please check that the naming and doc comments are to your liking.

private readonly Action _render;
private readonly Action _inputMarkerHandler;
private readonly HashSet<Compositor> _requestedCommits = new();
Expand Down
Loading