Skip to content

Commit e7d1ca1

Browse files
authored
Merge d3b26dc into 33d7b64
2 parents 33d7b64 + d3b26dc commit e7d1ca1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

source/eventHandler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def _getFocusLossCancellableSpeechCommand(
162162
) -> Optional[_CancellableSpeechCommand]:
163163
if reason != controlTypes.REASON_FOCUS or not speech.manager._shouldCancelExpiredFocusEvents():
164164
return None
165+
from NVDAObjects.behaviors import Dialog
165166
from NVDAObjects import NVDAObject
166167
if not isinstance(obj, NVDAObject):
167168
log.warning("Unhandled object type. Expected all objects to be descendant from NVDAObject")
@@ -181,6 +182,8 @@ def isSpeechStillValid():
181182
isLastFocusObj()
182183
or not previouslyHadFocus()
183184
or isAncestorOfCurrentFocus()
185+
# Ensure dialogs gaining focus are reported, EG NVDA Find dialog in a browser
186+
or isinstance(obj, Dialog)
184187
)
185188
return stillValid
186189

@@ -192,6 +195,7 @@ def getDevInfo():
192195
f"isLast: {isLastFocusObj()}"
193196
f", previouslyHad: {previouslyHadFocus()}"
194197
f", isAncestorOfCurrentFocus: {isAncestorOfCurrentFocus()}"
198+
f", is a Dialog: {isinstance(obj, Dialog)}"
195199
)
196200
return _CancellableSpeechCommand(isSpeechStillValid, getDevInfo)
197201

0 commit comments

Comments
 (0)