Skip to content

Ensure office app check is bound to window class#12854

Merged
michaelDCurran merged 4 commits into
nvaccess:masterfrom
LeonarddeR:fixSecureDesktop
Sep 17, 2021
Merged

Ensure office app check is bound to window class#12854
michaelDCurran merged 4 commits into
nvaccess:masterfrom
LeonarddeR:fixSecureDesktop

Conversation

@LeonarddeR
Copy link
Copy Markdown
Collaborator

@LeonarddeR LeonarddeR commented Sep 16, 2021

Link to issue number:

Fixes #12852

Summary of the issue:

Secure desktops were severly broken in Alpha.

Description of how this pull request fixes the issue:

First check for the proper window class before applying logic to detect office apps and versions.

Testing strategy:

T.B.D. I think we need a signed build for this.

Known issues with pull request:

None known

Change log entries:

None needed

Code Review Checklist:

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual testing.
  • API is compatible with existing addons.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers

@AppVeyorBot
Copy link
Copy Markdown

See test results for failed build of commit e8d9245774

@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

LeonarddeR commented Sep 16, 2021 via email

Comment thread source/_UIAHandler.py Outdated
@@ -756,7 +756,9 @@ def _isUIAWindowHelper(self,hwnd):
canUseOlderInProcessApproach = bool(appModule.helperLocalBindingHandle)
isOfficeApp = appModule.productName.startswith(("Microsoft Office", "Microsoft Outlook"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the log snipped I posted in #12852 I believe this fix would not be effective since fileUtils raises an error during execution of this line when trying to access productName of the LogonUI

@michaelDCurran
Copy link
Copy Markdown
Member

For now At very least a try accept RuntimeError is required around the call to appModule.productName I think.

@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

Here's another incarnation of the regression:

Traceback (most recent call last):
  File "core.py", line 702, in run
    IAccessibleHandler.pumpAll()
  File "IAccessibleHandler\__init__.py", line 946, in pumpAll
    if procFunc(*(focusWinEvent[1:])):
  File "IAccessibleHandler\__init__.py", line 613, in processFocusWinEvent
    NVDAEvent = winEventToNVDAEvent(winUser.EVENT_OBJECT_FOCUS, window, objectID, childID, useCache=False)
  File "IAccessibleHandler\__init__.py", line 473, in winEventToNVDAEvent
    if UIAHandler.handler and UIAHandler.handler.isUIAWindow(window):
  File "_UIAHandler.py", line 818, in isUIAWindow
    v=self._isUIAWindowHelper(hwnd),now
  File "_UIAHandler.py", line 757, in _isUIAWindowHelper
    isOfficeApp = appModule.productName.startswith(("Microsoft Office", "Microsoft Outlook"))
  File "baseObject.py", line 26, in __get__
    return self.fget(instance)
  File "appModuleHandler.py", line 413, in _get_productName
    self._setProductInfo()
  File "appModuleHandler.py", line 390, in _setProductInfo
    raise RuntimeError("processHandle is 0")
RuntimeError: processHandle is 0

@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

I did a rewrite of my approach. In short, I really want to do the appModule.productName call only when the window class is wwg. IN the current situation of master, every call of _isUIAWindowHelper tried to get the appName

@codeofdusk
Copy link
Copy Markdown
Contributor

Is this planned for merge?

@michaelDCurran
Copy link
Copy Markdown
Member

@michaelDCurran
Copy link
Copy Markdown
Member

with try build:

  • Verified that NVDA functioned on a secure desktop: could report focus with tab and shift+tab. NVDA menu could be read.
  • With Use UIA in MS Word document option off, Verified that UIA was used in MS Word for a build above 16.0.13900.
  • With Use UIA in MS Word document option off, Verified that UIA was not used in MS Word for build 16.0.13900.

@michaelDCurran michaelDCurran merged commit e36efe4 into nvaccess:master Sep 17, 2021
@nvaccessAuto nvaccessAuto added this to the 2021.3 milestone Sep 17, 2021
michaelDCurran pushed a commit that referenced this pull request Sep 18, 2021
In #12854 the CanUseOlderInProcessApproach check was moved to run only when checking Office windows. However, it is also used to check whether to use UIA in Chromium.

Description of how this pull request fixes the issue:
Move this check before all usages, restoring the ability to use UIA in Chromium.
michaelDCurran added a commit that referenced this pull request Oct 26, 2021
michaelDCurran added a commit that referenced this pull request Oct 27, 2021
We have tried to switch to using UI automation to access MS Word documents by default in NVDA 2021.3. However, there are still several issues remaining with our UIA support. Switching to UIA by default should be held back until these are addressed.
Some of these include:
• Support for math: Support mathML UIA custom property in MS Word #12946
• Reporting of line numbers: Requires UIA custom patterns support\
Over the last couple of months our UIA support has had a lot of fixes and improvements, mainly spured on by the apparent need to switch due to NVDA and MS Word not playing well together with the introduction of Modern Comments in MS Word build 13901. However, a work around has been found for #12982 now, making the swich less of a high priority.
Description of how this pull request fixes the issue:
Reverts #12859
Reverts #12854
Reverts #12770
@LeonarddeR LeonarddeR deleted the fixSecureDesktop branch August 23, 2025 06:27
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.

NVDA-alpha-23765 abnormal behavior on the secure desktop

6 participants