Repository navigation
perf(win32): Stop raising UIA bounds changes on layout (6.7) - #24787
Conversation
|
Claude finished @MartinZikmund's task in 2m 27s —— View job Review
Verdict: ✅ Approve (1 nit) 1 minor inline finding · 0 blockers Cross-cutting notesImplementation correctness — LGTM. The empty WinUI parity — LGTM. Test — LGTM. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24787/wasm-skia-net9/index.html |
|
Claude finished @MartinZikmund's task in 1m 29s —— View job Review
Verdict: ✅ Approve (1 outstanding nit from prior review) New commit (
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24787/wasm-skia-net9/index.html |
|
I'll analyze this and get back to you. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The regression is not directly tested, and an unrelated end-to-end test is disabled.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Removes costly Win32 UIA BoundingRectangle notifications during layout to match WinUI behavior.
Changes:
- Makes Win32 layout-bound notifications a no-op.
- Adds an on-demand bounds test.
- Disables an unrelated DevServer integration test.
| File | Description |
|---|---|
Given_Win32Accessibility.cs |
Tests bounds after movement. |
Win32Accessibility.cs |
Stops layout-time bounds notifications. |
RealAppLaunchIntegrationTests.cs |
Ignores incompatible integration test. |
| // Uno.Templates@*-* resolves to 7.0 prereleases, so MyApp is built on 7.0 packages and the | ||
| // locally built 6.x RemoteControl client never connects (no app-launch/connected event). | ||
| [TestMethod] | ||
| [Ignore("Uno.Templates@*-* scaffolds MyApp against 7.0 packages, which this 6.x build cannot connect to.")] |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24787/wasm-skia-net9/index.html |
|
|
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
Uno.Templates@*-* now resolves to 7.0.0-dev.17, so MyApp is built on 7.0 packages and the locally built 6.x RemoteControl client never connects. Mirrors the master ignore (37dc650). Refs #24800 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014RHVD5sbb5nMHzf8Lu24gZ
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G7PsEU6gSpLZXrYuK8WWpt
14ce795 to
ac87340
Compare
|
Claude finished @MartinZikmund's task in 1m 56s —— View job Review
Verdict: ✅ Approve — 0 new findings Prior nit — resolved
Copilot findings — addressed"Test does not verify BoundingRectangle events are suppressed" — Technically accurate, but intercepting COM-level UIA property-change events from a test process requires a real out-of-process UIA client. No such infrastructure exists in "Do not disable app-to-DevServer integration coverage" — The Cross-cutting — LGTM
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24787/wasm-skia-net9/index.html |
|
|
morning4coffe-dev
left a comment
There was a problem hiding this comment.
Verified: the change matches master #24785 in behavior. Win32Accessibility.OnSizeOrOffsetChanged no longer raises a UIA BoundingRectangle property change on layout, and the other heads are untouched. WinUI does not raise BoundingRectangle changes on layout (clients pull it on demand), so this is WinUI-consistent. The new runtime test's helpers (ResolveAccessibility, GetOrCreateProvider, GetBoundingRectangle) exist in the 6.7 test file.
Findings:
- Undisclosed test disable (blocking for merge as written). src/Uno.UI.RemoteControl.DevServer.Tests/AppLaunch/RealAppLaunchIntegrationTests.cs gains
[Ignore("Uno.Templates@*-* scaffolds MyApp against 7.0 packages, ...")]. That is unrelated to UIA bounds and the PR body does not mention it. Please either move it to its own PR or add a line to the body explaining why the test is off on 6.7 and what re-enables it. Note that master's copy of the same test carries a different [Ignore] reason, so the branches disagree on why it is disabled. - Structural difference, no behavior impact: master #24785 makes SkiaAccessibilityBase.OnSizeOrOffsetChanged virtual with an empty default and drops the Win32 override. This 6.7 port keeps the base abstract and adds an empty Win32 override with an unused parameter. Acceptable for 6.7; no change needed.
Validation: code review and WinUI source check only. I did not build or run tests. The PR body's runtime results come from the 6.8 backport (#24786), not from this 6.7 branch.


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.Backport of the master fix. 6.7 ships the same
Win32Accessibilitypath.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