Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore backwards compatibility of SecureDesktopNVDAObject #14116

Merged
merged 1 commit into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions source/IAccessibleHandler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import keyboardHandler
from logHandler import log
import mouseHandler
from NVDAObjects import NVDAObject
import NVDAObjects.IAccessible
import NVDAObjects.window
import winUser
Expand Down Expand Up @@ -772,7 +771,7 @@ def processFocusNVDAEvent(obj, force=False):
return True


class SecureDesktopNVDAObject(NVDAObject):
class SecureDesktopNVDAObject(NVDAObjects.window.Desktop):
"""
Used to indicate to the user and to API consumers (including NVDA remote),
that the user has switched to a secure desktop.
Expand All @@ -781,23 +780,12 @@ class SecureDesktopNVDAObject(NVDAObject):
The gainFocus event causes NVDA to enter sleep mode as the secure mode
NVDA instance starts on the secure screen.

This object is not backed by a valid MSAA object as the Secure Desktop
object should not be accessed via NVDA.
The minimal functionality has been added to support backwards compatibility.
This object is backed by a valid MSAA object.
However, as information from the Secure Desktop object should not be accessed via this instance of NVDA,
getting related objects returns None.
This object must remain a Desktop subclass to retain backwards compatibility.
"""

def __init__(self, windowHandle: int):
"""
@param windowHandle: to retain backwards compatibility,
unused as this object is not backed by a valid MSAA object.
This object just serves as a minimal API endpoint.
"""
self._windowHandle = windowHandle
super().__init__()

def _get_processID(self) -> int:
return 0

def findOverlayClasses(self, clsList):
clsList.append(SecureDesktopNVDAObject)
return clsList
Expand All @@ -814,6 +802,21 @@ def event_gainFocus(self):
# After handling the focus, NVDA should sleep while the secure desktop is active.
self.sleepMode = self.SLEEP_FULL

def _get_next(self) -> None:
return None

def _get_previous(self) -> None:
return None

def _get_firstChild(self) -> None:
return None

def _get_lastChild(self) -> None:
return None

def _get_parent(self) -> None:
return None


def processDesktopSwitchWinEvent(window, objectID, childID):
if isMSAADebugLoggingEnabled():
Expand Down
8 changes: 0 additions & 8 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ This is a patch release to fix an accidental API breakage introduced in 2022.2.1
This caused NVDA remote to not recognize secure desktops. (#14094)
-

== Changes for Developers ==
This release contains a technical breakage in API backwards compatibility.
It is expected that this change does not affect any add-ons.
Please open a GitHub issue if your add-on becomes incompatible as a result of this release.

- ``SecureDesktopNVDAObject`` is no longer a subclass of ``Desktop`` or ``Window``. (#14105)
-

= 2022.2.2 =
This is a patch release to fix a bug introduced in 2022.2.1 with input gestures.

Expand Down