Skip to content

Commit

Permalink
When entering a secure desktop, cancel speech (#14135)
Browse files Browse the repository at this point in the history
Summary of the issue:
NVDA 2022.2 would cancel speech when handling the foreground event for entering a secure desktop.

The security patch for 2022.2.1 broke how the foreground event was handled, and subsequently #14105 opted to avoid the foreground event entirely.

This results in NVDA not correctly cancelling speech when entering a secure desktop.

Description of user facing changes
Speech is cancelled when entering a secure desktop

Description of development approach
Cancel speech just before enter sleep mode, when SecureDesktopNVDAObject handles it's gain focus event.
  • Loading branch information
seanbudd authored Sep 15, 2022
1 parent 8eac659 commit c53bc97
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion source/IAccessibleHandler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,18 @@ def _get_role(self):
return controlTypes.Role.PANE

def event_gainFocus(self):
super(SecureDesktopNVDAObject, self).event_gainFocus()
from speech.speech import cancelSpeech
# NVDA announces the secure desktop when handling the gainFocus event.
# Before announcing the secure desktop and entering sleep mode,
# cancel speech so that speech does not overlap with the new instance of NVDA
# started on the secure desktop.
# Cancelling speech was previously handled by a foreground event,
# fired when focusing SecureDesktopNVDAObject.
# The foreground event would incorrectly fire on the foreground window of the user desktop.
# This foreground event is now explicitly prevented due to the security concerns of
# setting the foreground object to an object 'below the lock screen'.
cancelSpeech()
super().event_gainFocus()
# After handling the focus, NVDA should sleep while the secure desktop is active.
self.sleepMode = self.SLEEP_FULL

Expand Down

0 comments on commit c53bc97

Please sign in to comment.