Skip to content

Fix some issues where an NVDAObject is used where a Window is expected#15400

Merged
seanbudd merged 3 commits into
masterfrom
try-fixSecureDesktop
Sep 21, 2023
Merged

Fix some issues where an NVDAObject is used where a Window is expected#15400
seanbudd merged 3 commits into
masterfrom
try-fixSecureDesktop

Conversation

@seanbudd

@seanbudd seanbudd commented Sep 8, 2023

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #15395

Summary of the issue:

There are many instances in NVDA where we implicitly or explicitly (with typing) expect an NVDAObject but code uses properties only available for a NVDAObjects.window.Window.
This is because most objects are Windows and usually these implicit expectations are safe.
This PR attempts to catch some known instances where these expectations are not safe.

Description of user facing changes

Fix error when switching to the secure desktop

Description of development approach

Improve typing and catch some likely cases where a Window should not be expected

Testing strategy:

Test using the secure desktop, check log for errors

Known issues with pull request:

There are other instances where this is the case.
Future work such as improved typing will help weed out these problems.

Change log entries:

None, unreleased regression

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • Security precautions taken.

@seanbudd seanbudd added this to the 2024.1 milestone Sep 8, 2023
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 24fab6bc3a

Comment thread source/keyboardHandler.py Outdated
Comment thread source/keyboardHandler.py Outdated
seanbudd and others added 2 commits September 8, 2023 16:15
Co-authored-by: Leonard de Ruijter <leonardder@users.noreply.github.com>
@seanbudd seanbudd marked this pull request as ready for review September 20, 2023 22:57
@seanbudd seanbudd requested a review from a team as a code owner September 20, 2023 22:57
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 102cf345c7

@seanbudd seanbudd merged commit 42bc805 into master Sep 21, 2023
@seanbudd seanbudd deleted the try-fixSecureDesktop branch September 21, 2023 00:54
seanbudd pushed a commit that referenced this pull request Feb 4, 2024
Fix #16120
Related to #15400.

Summary of the issue:
Sporadic errors still occur when locking/unlocking Windows session. As per #15400, this is due to the fact that api.getFocusObject returns an NVDAObjects.NVDAObject but we use it as it was an NVDAObjects.window.Window. But that's not the case when the focus is (or was) winAPI.secureDesktop._handleSecureDesktopChange._SecureDesktopNVDAObject.

Description of user facing changes
Probably none; these errors did not seem to have any visible impact.

Description of development approach
Check the class of the object returned by api.getFocusObject before using its properties.
Adriani90 pushed a commit to Adriani90/nvda that referenced this pull request Mar 13, 2024
)

Fix nvaccess#16120
Related to nvaccess#15400.

Summary of the issue:
Sporadic errors still occur when locking/unlocking Windows session. As per nvaccess#15400, this is due to the fact that api.getFocusObject returns an NVDAObjects.NVDAObject but we use it as it was an NVDAObjects.window.Window. But that's not the case when the focus is (or was) winAPI.secureDesktop._handleSecureDesktopChange._SecureDesktopNVDAObject.

Description of user facing changes
Probably none; these errors did not seem to have any visible impact.

Description of development approach
Check the class of the object returned by api.getFocusObject before using its properties.
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.

Error when activating secure desktop

4 participants