Skip to content

Use CurrentDispatcher in DispatcherTimer and AvaloniaSynchronizationContext#20957

Open
MrJul wants to merge 4 commits intoAvaloniaUI:masterfrom
MrJul:fix/dispatcher-uithread-usages
Open

Use CurrentDispatcher in DispatcherTimer and AvaloniaSynchronizationContext#20957
MrJul wants to merge 4 commits intoAvaloniaUI:masterfrom
MrJul:fix/dispatcher-uithread-usages

Conversation

@MrJul
Copy link
Member

@MrJul MrJul commented Mar 20, 2026

What does the pull request do?

This PR changes the default dispatcher used by the DispatcherTimer and AvaloniaSynchronizationContext classes from UIThread to CurrentDispatcher.

This is a behavioral breaking change that is needed for dispatcher timers to work as expected in the presence of multiple dispatchers.

Most applications should be unaffected, but users who were creating a DispatcherTimer from a background thread, expecting it to tick on the UIThread, will need to adjust their code.

maxkatz6
maxkatz6 previously approved these changes Mar 20, 2026
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0063793-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants