Fix high GPU usage from always-running indeterminate ProgressBar animations#5061
Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit intoJul 8, 2026
Merged
Conversation
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Jul 8, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The cause is that every indeterminate ProgressBar in the app was declared with a static IsIndeterminate="True" and only toggled via IsVisible (or Opacity). An indeterminate bar runs an infinite animation, and that animation clock keeps running for the control's entire lifetime — hiding the control doesn't stop it. A live animation keeps Avalonia's compositor render loop producing a new frame at the display's refresh rate instead of going idle.
By itself that's cheap. But on a transparent Mica window the compositor loses cheap partial (dirty-rect) presents — each committed frame forces a full-window present plus a DWM blend against the backdrop. On a high-refresh, high-DPI laptop panel driven by an integrated GPU, doing that 120–165×/second is what spikes GPU usage.
Fix
Bind IsIndeterminate to the same flag that controls the bar's visibility, so the animation clock actually stops when the bar is hidden and the render loop can go idle.
this fix dropped the GPU usage to 0.1% on my computer when idle