Skip to content

Commit 81d7d92

Browse files
authored
Fixed a bug where NVDA sometimes was unable to reset the configuration to factory defaults when using the NVDA+control+r command (#16919)
fixes #16896 Summary of the issue: Sometimes, when pressing the NVDA+control+r command three times, NVDA wouldn't reset the configuration to factory defaults, but instead produce the following error ERROR - keyboardHandler.internal_keyDownEvent (10:14:40.187) - winInputHook (13232): internal_keyDownEvent Traceback (most recent call last): File "keyboardHandler.pyc", line 245, in internal_keyDownEvent File "inputCore.pyc", line 535, in executeGesture AttributeError: 'NoneType' object has no attribute 'suppressClearBrailleRegions' Description of user facing changes The user will reliably be able to reset the configuration to factory defaults with the NVDA+control+r command Description of development approach the suppressCancelSpeech function is only defined and called if braille.handler is not None, otherwise, speech.cancelSpeech is called
1 parent d69e0b2 commit 81d7d92

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

source/inputCore.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -531,16 +531,23 @@ def executeGesture(self, gesture):
531531
if speechEffect == gesture.SPEECHEFFECT_CANCEL:
532532
# Import late to avoid circular import.
533533
import braille
534+
if braille.handler:
535+
@braille.handler.suppressClearBrailleRegions(script)
536+
def suppressCancelSpeech():
537+
speech.cancelSpeech()
538+
539+
queueHandler.queueFunction(
540+
queueHandler.eventQueue,
541+
suppressCancelSpeech,
542+
_immediate=immediate,
543+
)
544+
else:
545+
queueHandler.queueFunction(
546+
queueHandler.eventQueue,
547+
speech.cancelSpeech,
548+
_immediate=immediate,
549+
)
534550

535-
@braille.handler.suppressClearBrailleRegions(script)
536-
def suppressCancelSpeech():
537-
speech.cancelSpeech()
538-
539-
queueHandler.queueFunction(
540-
queueHandler.eventQueue,
541-
suppressCancelSpeech,
542-
_immediate=immediate,
543-
)
544551
elif speechEffect in (gesture.SPEECHEFFECT_PAUSE, gesture.SPEECHEFFECT_RESUME):
545552
queueHandler.queueFunction(queueHandler.eventQueue, speech.pauseSpeech, speechEffect == gesture.SPEECHEFFECT_PAUSE)
546553

user_docs/en/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ A warning message will inform you if you try writing to a non-empty directory. (
7474
* No longer cause Google Chrome to crash when closing a document or exiting Chrome. (#16893)
7575
* NVDA will announce correctly the autocomplete suggestions in Eclipse and other Eclipse-based environments on Windows 11. (#16416, @thgcode)
7676
* Improved reliability of automatic text readout, particularly in terminal applications. (#15850, #16027, @Danstiv)
77+
* It is once again possible to reset the configuration to factory defaults reliably. (#16755, @Emil-18)
7778
* NVDA will correctly announce selection changes when editing a cell's text in Microsoft Excel. (#15843)
7879
* In applications using Java Access Bridge, NVDA will now correctly read the last blank line of a text instead of repeating the previous line. (#9376, @dmitrii-drobotov)
7980
* In LibreOffice Writer (version 24.8 and newer), when toggling text formatting (bold, italic, underline, subscript/superscript, alignment) using the corresponding keyboard shortcut, NVDA announces the new formatting attribute (e.g. "Bold on", "Bold off"). (#4248, @michaelweghorn)

0 commit comments

Comments
 (0)