Skip to content

Commit d3db45f

Browse files
authored
Merge a41fe79 into bd5b338
2 parents bd5b338 + a41fe79 commit d3db45f

5 files changed

Lines changed: 18 additions & 4 deletions

File tree

source/IAccessibleHandler/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# A part of NonVisual Desktop Access (NVDA)
2-
# Copyright (C) 2006-2021 NV Access Limited, Łukasz Golonka, Leonard de Ruijter
2+
# Copyright (C) 2006-2022 NV Access Limited, Łukasz Golonka, Leonard de Ruijter
33
# This file is covered by the GNU General Public License.
44
# See the file COPYING for more details.
55

@@ -797,6 +797,7 @@ def processDesktopSwitchWinEvent(window, objectID, childID):
797797
)
798798
hDesk = windll.user32.OpenInputDesktop(0, False, 0)
799799
if hDesk != 0:
800+
api.setDesktopObject(NVDAObjects.window.Desktop(windowHandle=hDesk))
800801
windll.user32.CloseDesktop(hDesk)
801802
core.callLater(200, _correctFocus)
802803
else:
@@ -805,6 +806,7 @@ def processDesktopSwitchWinEvent(window, objectID, childID):
805806
# so clear our recorded modifiers.
806807
keyboardHandler.currentModifiers.clear()
807808
obj = SecureDesktopNVDAObject(windowHandle=window)
809+
api.setDesktopObject(obj)
808810
eventHandler.executeEvent("gainFocus", obj)
809811

810812

source/NVDAObjects/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,10 @@ def objectWithFocus():
330330
return obj
331331

332332
@staticmethod
333-
def objectInForeground():
333+
def objectInForeground() -> typing.Optional["NVDAObject"]:
334334
"""Retrieves the object representing the current foreground control according to the
335335
Operating System. This may differ from NVDA's cached foreground object.
336336
@return: the foreground object
337-
@rtype: L{NVDAObject}
338337
"""
339338
kwargs={}
340339
APIClass=NVDAObject.findBestAPIClass(kwargs,relation="foreground")

source/eventHandler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def doPreGainFocus(obj: "NVDAObjects.NVDAObject", sleepMode: bool = False) -> bo
329329

330330
if globalVars.focusDifferenceLevel<=1:
331331
newForeground=api.getDesktopObject().objectInForeground()
332-
if not newForeground:
332+
if not newForeground or _isSecureObjectWhileLockScreenActivated(newForeground):
333333
log.debugWarning("Can not get real foreground, resorting to focus ancestors")
334334
ancestors=api.getFocusAncestors()
335335
if len(ancestors)>1:

source/utils/security.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def isObjectAboveLockScreen(obj: "NVDAObjects.NVDAObject") -> bool:
105105
but other Windows can be focused (e.g. Windows Magnifier).
106106
"""
107107
import appModuleHandler
108+
from IAccessibleHandler import SecureDesktopNVDAObject
108109
from NVDAObjects.IAccessible import TaskListIcon
109110

110111
foregroundWindow = winUser.getForegroundWindow()
@@ -118,6 +119,10 @@ def isObjectAboveLockScreen(obj: "NVDAObjects.NVDAObject") -> bool:
118119
# The task switcher window does not become the foreground process on the lock screen,
119120
# so we must whitelist it explicitly.
120121
isinstance(obj, TaskListIcon)
122+
# Secure Desktop Object.
123+
# Used to indicate to the user and to API consumers (including NVDA remote),
124+
# that the user has switched to a secure desktop.
125+
or isinstance(obj, SecureDesktopNVDAObject)
121126
):
122127
return True
123128

user_docs/en/changes.t2t

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ What's New in NVDA
33

44
%!includeconf: ../changes.t2tconf
55

6+
= 2022.2.3 =
7+
This is a patch release to fix an accidental API breakage introduced in 2022.2.1.
8+
9+
== Bug Fixes ==
10+
- Fixed a bug where NVDA did not announce "Secure Desktop" when entering a secure desktop.
11+
This caused NVDA remote to not recognize secure desktops. (#14094)
12+
-
13+
614
= 2022.2.2 =
715
This is a patch release to fix a bug introduced in 2022.2.1 with input gestures.
816

0 commit comments

Comments
 (0)