Free display on secure desktop switch (#18810)
Fixes #2315
Summary of the issue:
Currently, braille doesn't work properly on secure screens because the
braille display is held by the logged in copy.
Description of user facing changes:
When NVDA is installed, it disconnects braille when entering secure
desktop and reconnects when exiting it.
Description of developer facing changes:
None
Description of development approach:
1. Added a secure desktop switch extension point to the braille handler.
2. Set a private class property on the braille display driver to ensure
the display isn't cleared, in order to make it clear that the `secure
desktop` was entered. This is communicated with an `ui.message` in
IAccessibleHandler.
3. When leaving secure desktop and auto detect was enabled, try to
reconnect to the last detected display before doing a full scan.
Testing strategy:
- [X] Tested via USB with a APH Mantis Q40
- [x] Tested via Bluetooth with a APH Mantis Q40 as the only Bluetooth
device available
- [x] Tested both automatic detect and manual display selection cases
Known issues with pull request:
1. After exiting the secure desktop, it takes some time before the
display is back in action. I must say though that with Bluetooth this
isn't considerably slower
2. When using a custom braille display driver bundled in an add-on, the
add-on needs to be available on the system copy of NVDA. This has always
been the case though, but is fixable with the approach in #18789.
3. When using manual braille display selection, reconnecting to the
display after closing the secure desktop happens on the main thread.
This can lead to a temporary freeze of NVDA, depending on how long it
takes for the driver to connect. Note however that the same freeze would
occur when starting NVDA.