-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix [Accessibility] Accessibility Insights tool keeps loading when mouse-over DataGridView #10343 #10372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@Epica3055 - great fix and great explanation! Please make sure to test it for memory leaks. |
|
|
||
| // The null-check was added as a fix for a https://github.com/dotnet/winforms/issues/2138 | ||
| if (_dataGridView?.IsAccessibilityObjectCreated == true) | ||
| if (m.MsgInternal == PInvoke.WM_GETOBJECT && IsHandleCreated && _dataGridView?.IsAccessibilityObjectCreated == true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
|
Looks good, but I'm not sure about the shipped/unshipped API file changes. Please look up history of these files to see how we are removing overrides. I believe we are marking them with |
e40303a to
a5e8139
Compare
…use-over DataGridView dotnet#10343
38c0de8 to
fe96112
Compare
|
@Epica3055 - please send these privates to @Olina-Zhang for testing before porting to release/8.0 |
|
Olina tested this PR, and found there is a memory-leak problem. |
|
/backport to release/8.0 |
|
Started backporting to release/8.0: https://github.com/dotnet/winforms/actions/runs/7189547779 |
|
@Epica3055 backporting to release/8.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: fix [Accessibility] Accessibility Insights tool keeps loading when mouse-over DataGridView #10343
Using index info to reconstruct a base tree...
M src/System.Windows.Forms/src/PublicAPI.Unshipped.txt
A src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewComboBoxEditingControl.cs
A src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewTextBoxEditingControl.cs
Falling back to patching base and 3-way merge...
Auto-merging src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxEditingControl.cs
Auto-merging src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxEditingControl.cs
Auto-merging src/System.Windows.Forms/src/PublicAPI.Unshipped.txt
CONFLICT (content): Merge conflict in src/System.Windows.Forms/src/PublicAPI.Unshipped.txt
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 fix [Accessibility] Accessibility Insights tool keeps loading when mouse-over DataGridView #10343
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
@Epica3055 - Great investigation, thanks! |
Fix #10343
Related to PR_7349
Cause of this issue
Take a look here this PR_7349 had made

Same as this:
https://github.com/dotnet/winforms/pull/7349/files#diff-2cdcad323e7cd83529f6ded1cfd60aa6906ccbb32755221d36cdb67f72b507c0L306-L315
We can see this PR_7349 was to address memory leaks.
Indeed the code here was problematic because if there are no Accessibility Client listening to then there is no need to create AccessibilityObject
The author addressed this problem by this
But this posed another problem, when the handle is created before Accessibility Client is activated, the code here
_dataGridView.SetAccessibleObjectParent(AccessibilityObject);never get a chance to be involved.https://github.com/dotnet/winforms/blob/71aeb2e40dc2d6d7972e86665857c84cc7e8e02e/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView/DataGridView.Methods.cs#L27496C4-L27507
As we can see: the editingControl has no parent.
Regression?
Screenshots
Before
After
Test methodology
Test environment(s)
9.0.0-alpha.1.23572.27