Skip to content
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

Don't use UnidentifiedEdit for windows with empty windowText #11966

Merged

Conversation

lukaszgo1
Copy link
Contributor

Link to issue number:

None, regression from PR #8165

Summary of the issue:

PR #8165 started using UnidentifiedEdit for windows which contain a caret and for which EM_LINELENGTH returns 1 or more. Unfortunately I've seen cases in the wild in which EM_LINELENGTH returns count of lines in the edit field yet it's windowText is empty and UnidentifiedEdit relies on windowText being correct to retrieve content.

Description of how this pull request fixes the issue:

If the given window responds to EM_LINELENGTH with a positive value before adding UnidentifiedEdit to its MRO we're now checking if it windowText is not empty.

Testing performed:

Ensured that main editor in BASCOM_AVR from MCS Electronics is once again readable.

Known issues with pull request:

It's theoretically possible that getting windowtext before adding UnidentifiedEdit can cause performance problems. I'm reluctant to use an appModule based approach here because using class which requires windowText to be correct for windows for which windowText is empty makes no sense.

Change log entry:

Section: Bug fixes

Fixed access to edit fields in MCS Electronics IDE's

@michaelDCurran
Copy link
Member

@lukaszgo1 Can you please give a bit more explanation as to the exact issue with edit fields in MCS Electronics IDE? If we suppress these windows from being classed as an unidentified edit, what does the user then experience? How is it "once again readable"?

@lukaszgo1
Copy link
Contributor Author

@michaelDCurran wrote:

Can you please give a bit more explanation as to the exact issue with edit fields in MCS Electronics IDE? If we suppress these windows from being classed as an unidentified edit, what does the user then experience? How is it "once again readable"?

When we're not using unidentified edit to access these edit fields NVDA falls back to the DisplayModelEditableText which makes text of these controls reported when navigating with the system caret. Without this fix these edit fields are reported as empty.

@AppVeyorBot
Copy link

See test results for failed build of commit f5db84962c

@michaelDCurran michaelDCurran merged commit 4288882 into nvaccess:master Jan 11, 2021
@nvaccessAuto nvaccessAuto added this to the 2021.1 milestone Jan 11, 2021
@lukaszgo1 lukaszgo1 deleted the noUnidentifiedEditWhenWindowTextEmpty branch January 11, 2021 23:52
lukaszgo1 added a commit to lukaszgo1/nvda that referenced this pull request May 18, 2021
michaelDCurran pushed a commit that referenced this pull request May 19, 2021
…11966)" (#12429)

This reverts commit 4288882.

PR #11966 started using DisplayModelEditableText for edit fields with empty window text to improve access to IDE's by MCS Electronic - this unfortunately broke access to some edit fields in Excel as they were forcibly using DisplayModelEditableText and now they were getting this class twice in the MRO. When trying to come up with a fix I've found another problems with the approach from #11966 namely edit fields which require UnidentifiedEdit weren't getting it in the MRO when they are initially empty.

Since we're quite close to the release it makes sense to revert #11966 for now and investigate another approach - the program for which the original fix was needed is quite niche and therefore I don't consider this to be a big loss. I'll try to come up with something better for the next release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants