Skip to content

Cherry-pick #20646 "Clear the braille display on system shutdown" to beta - #20663

Merged
seanbudd merged 1 commit into
betafrom
cherry-pick-braille-clear
Aug 15, 2026
Merged

Cherry-pick #20646 "Clear the braille display on system shutdown" to beta#20663
seanbudd merged 1 commit into
betafrom
cherry-pick-braille-clear

Conversation

@SaschaCowley

Copy link
Copy Markdown
Member

This cherry-picks #20646 from master to beta.

Care must be taken when merging beta to master to remove the duplicate changes entry.

Closes nvaccess/nvda/security/advisories/GHSA-qhjv-3xf4-9c66
Follow-up to #18810
Summary of the issue:

When the machine is shut down or restarted with NVDA running and a braille display connected, the display is not reliably updated before NVDA exits. Depending on timing and braille message settings, whatever was last written to the display can remain on it until the display is refreshed or powered off.
Description of user facing changes:

When shutting down or restarting the computer with NVDA running and a braille display connected, the braille display now either shows "Secure Desktop" or is cleared entirely.
Description of developer facing changes:

None.
Description of development approach:

Two changes:

    In braille.brailleHandler.BrailleHandler._onSecureDesktopStateChanged, call self.update() after clearing the main buffer and before switching to the no-braille fallback. The "Secure Desktop" text is presented as an alert, which is not necessarily written to the display. If it isn't, clearing the buffer has no visible effect until the next display update, and by the time this function returns the display has been freed, so later code can no longer refresh it without re-acquiring it.
    In our wx app's WM_ENDSESSION handler, disable braille (by registering a braille.extensions.decide_enabled handler that always returns False) and then call braille.handler._clearAll() if a braille handler exists.

In practice step 2 is usually a no-op for me, because the secure desktop state change handler frees the display first, but I don't believe that ordering is guaranteed. To confirm step 2 works on its own, I temporarily removed the session lock and secure desktop state change bindings in BrailleHandler and verified the WM_ENDSESSION path behaves correctly.
@SaschaCowley
SaschaCowley requested a review from a team as a code owner August 14, 2026 06:05
@SaschaCowley
SaschaCowley requested a review from seanbudd August 14, 2026 06:05
@seanbudd seanbudd added this to the 2026.2 milestone Aug 14, 2026
@seanbudd
seanbudd merged commit 91b8f92 into beta Aug 15, 2026
105 of 111 checks passed
@seanbudd
seanbudd deleted the cherry-pick-braille-clear branch August 15, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants