Repository navigation
perf(win32): Stop raising UIA bounds changes on layout - #24785
Conversation
Win32Accessibility raised a BoundingRectangle property-changed event for every element whose visual moved or resized. UIA clients (PowerToys, TextInputHost, browsers) are listening on most desktops, so every scroll frame paid a native UIA call per realized element. WinUI never raises this event on layout; clients pull BoundingRectangle on demand. ItemsRepeater grid of 2837 Fluent Buttons, 12 x 60 scroll steps, UI-thread accessibility time: 386 ms -> 148 ms. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AzHtsXz33DcziPre7h3b9f
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AzHtsXz33DcziPre7h3b9f
|
Claude finished @MartinZikmund's task in 1m 46s —— View job Review complete ✅
Verdict: ship — this is a clean, well-scoped performance fix. Findings by severity: 1 nit (non-blocking), 0 blocking issues. What I checked:
Cross-cutting note (see inline comment): the base class's scroll re-emission path ( |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24785/wasm-skia-net9/index.html |
|
The build 235987 found UI Test snapshots differences: Details
|
|
|
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JMMdjBbZdcVRtySgtUG1g7
|
Claude finished @MartinZikmund's task in 1m 45s —— View job Review complete ✅
Verdict: ship — re-reviewed this PR independently (diff unchanged since the last automated pass); confirms the earlier findings and turns up nothing new. Findings by severity: 0 new blocking issues, 0 new nits. The one previously-flagged nit (below) still stands as a non-blocking follow-up. What I verified:
Cross-cutting note (already flagged inline in the prior review, still open as a follow-up, not a blocker): |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24785/wasm-skia-net9/index.html |
|
The build 236215 found UI Test snapshots differences: Details
|
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
GitHub Issue: closes #24784
PR Type:
🐞 Bugfix (performance)
What changed? 🚀
Win32Accessibility.OnSizeOrOffsetChangedraised a UIABoundingRectangleproperty-changed event for every element whose visual moved or resized. On most desktops a UIA client is listening (PowerToys, TextInputHost and Chromium browsers all register as one;UiaClientsAreListening()returnedtrueon the test machine). So every scroll frame paid a nativeUiaRaiseAutomationPropertyChangedEventcall per realized element, and a listener gate alone would not help.WinUI never raises this event on layout.
CUIAWrapper::get_BoundingRectangleserves it on demand, and nothing indxaml/xcpraisesBoundingRectanglechanges. This PR drops the per-move raise to match.RaiseAutomaticPropertyChangeson move (IsOffscreen/Name/…) is unchanged, since WinUI does the equivalent from its layout pass.Measured on the 6.8 backport; the change is identical, and master has the same unconditional raise.
Measurements 📊
ItemsRepeater+UniformGridLayout, 2,837 FluentButtontiles, 12 × 60ChangeViewsteps of 40 px, Skia Win32. UI-thread time fromdotnet-tracedotnet-sampled-thread-time(6.8 build, on top of the damage fix):What remains is
NotifyPropertyChangedEventfrom recycledTextBlocktext changes, which WinUI raises as well.PR Checklist ✅
Screenshots Compare Test Runresults.Validation
Given_Win32Accessibility8/8, including the newWhen_Element_Moves_BoundingRectangle_Is_Current, which checks that a client pulling bounds after a move gets the new position. The widerWindows_UI_Xaml_Automationrun hit the known pre-existing secondary-window teardown crash (WglCurrentContextDisposable.Dispose→GetErrorMessagenull); every test before that passed.Uno.UI.Runtime.Skia.Win32built withoutUnoFastDevBuild, so analyzers ran, on master and 6.8.🤖 Generated with Claude Code
https://claude.ai/code/session_01AzHtsXz33DcziPre7h3b9f