nvda
e830843f - Clear the braille display on system shutdown (#20646)

Commit
6 days ago
Clear the braille display on system shutdown (#20646) 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.
Author
Parents
Loading