[release/11.0] Fix inverted NoClientNotifications check in Control.AccessibilityNotifyClients - #15222
Merged
Merged
Conversation
…fyClients (#15177) The rename of LocalAppContextSwitches to AppContextSwitches in #12840 dropped the negation on this line (and only on this one of the seven that use the switch), so controls only call NotifyWinEvent when the app has asked for NO client notifications, that is, never by default. MSAA clients (JAWS among them) stopped receiving the WinEvents raised through this method: menu popup start/end, focus of ToolStrip items, state and selection changes, etc. .NET 9: if (IsHandleCreated && !LocalAppContextSwitches.NoClientNotifications) .NET 10: if (IsHandleCreated && AppContextSwitches.NoClientNotifications) Adds tests that listen to the WinEvent; the existing ones only checked that the call did not throw.
Member
|
Approved over email. |
yaqiyang
approved these changes
Oct 1, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The fix and regression tests are covered, with no unresolved blocking issues.
Review effort: Lite
Findings: None
What changed in this PR
Fixes the inverted NoClientNotifications check so MSAA WinEvents are raised by default and suppressed when opted out.
Changes:
- Corrects notification gating logic.
- Adds regression tests for event data and suppression.
| File | Description |
|---|---|
src/test/unit/System.Windows.Forms/System/Windows/Forms/ControlTests.AccessibilityNotifyClients.cs |
Adds WinEvent regression coverage. |
src/System.Windows.Forms/System/Windows/Forms/Control.cs |
Corrects notification gating. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Backport of #15177 to release/11.0
/cc @Shyam-Gupta @kastwey
Customer Impact
Testing
Risk
Microsoft Reviewers: Open in CodeFlow