Skip to content

fix: Scrolling reliability#22921

Open
MartinZikmund wants to merge 1 commit intomasterfrom
dev/mazi/scrolling-reliable
Open

fix: Scrolling reliability#22921
MartinZikmund wants to merge 1 commit intomasterfrom
dev/mazi/scrolling-reliable

Conversation

@MartinZikmund
Copy link
Copy Markdown
Member

GitHub Issue: closes #

PR Type:

What is the current behavior? 🤔

Improve scrolling reliability before #22873

What is the new behavior? 🚀

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts ScrollViewer’s deferred intermediate scrolling updates to be scheduled at normal dispatcher priority (instead of idle) to improve update reliability during sustained scrolling.

Changes:

  • Switch deferred update scheduling from Dispatcher.RunIdleAsync(...) to Dispatcher.RunAsync(CoreDispatcherPriority.Normal, ...) in ScrollViewer.RequestUpdate().
Comments suppressed due to low confidence (1)

src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.cs:1333

  • In RequestUpdate(), _hasPendingUpdate is set to true only after scheduling the dispatcher callback. If the dispatcher implementation ever executes the callback synchronously (e.g., via a custom CoreDispatcher.DispatchOverride in some hosts/tests), the callback can observe _hasPendingUpdate == false, skip Update(...), and then _hasPendingUpdate becomes true with no further callback queued (updates can get stuck). Set _hasPendingUpdate = true before calling Dispatcher.RunAsync(...) to make the ordering robust.
			_ = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
			{
				if (_hasPendingUpdate)
				{
					Update(isIntermediate: true);
				}
			});
			_hasPendingUpdate = true;
		}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22921/wasm-skia-net9/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants