Skip to content

Commit f35d632

Browse files
authored
Merge 1279bd2 into 8eac659
2 parents 8eac659 + 1279bd2 commit f35d632

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

source/IAccessibleHandler/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,17 @@ def _get_role(self):
798798
return controlTypes.Role.PANE
799799

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

0 commit comments

Comments
 (0)