File tree Expand file tree Collapse file tree
source/IAccessibleHandler Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments