nvda
aa6b9851 - Event handler: introduce virtual desktop announcement switch handling (#14932)

Commit
2 years ago
Event handler: introduce virtual desktop announcement switch handling (#14932) Fixes #5641 Summary of the issue: In Windows 10 and later, NVDA does not announce virtual desktop names wen they are opened, switched, and closed. Description of user facing changes NVDA will announce names of virtual desktops when opening, switching, and closing them. Description of development approach Event handler is extended to include a virtual desktop switch handler and an extension to execute event to catch a name change event coming from CSRSS. --- commits: * Event handler: update copyright header. Re #5641 * Event handler/virtual desktops announcement: use a dedicated function to handle possible virtual desktop switches. Re #5641. Original work by Jamie Teh (Mozilla): define a dedicated function to handle posible (and real) Windows 10/11 virtual desktop switche announcements. This function checks to make sure this is Widows 10 or later, and if yes, announces desktop name as defined in the event handler module, and clears this string once announcements are done. The actual event responsible for placing virtual desktop name in event handler is name change event from CSRSS (client/server runtime subsystem/Windows subsystem) process, specificlaly desktop object. Handling name change event will be done as part of handling gain focus event, specifically when doing pre-gain focus routine. * Event handler/virtual desktop switch announcements: detect name change event coming from CSRSS/desktop object and treat as a possible virtual desktop switch. Re #5641. Original idea from Jamie Teh (Mozilla): in 'execute event' function, detect namechange coming from CSRSS/desktop object and treat it as a possible virtual desktop name change before handling focus events. If it turns out this is indeed a virtual desktop switch, set virtual desktop name, then queue handle possible virtual desktop switch routine (250 milliseconds) so desktop switches can be announced when opening/closing/switching virtual desktops while focused on the desktop. * Event handler/virtual desktop switch announcements: handle possible virtual desktop switches after handling new foreground event. Re #5641. Credit: Jamie Teh (Mozilla): handle possible virtual desktop switch announcements after handling new foreground announcement in 'do pre gain focus' routine. This allows virtual desktop names to be announced between actual desktop switch and handling gain focus event, more noticeable when creating new virtual desktops. * Event handler/virtual desktop switch announcement: limit announcement to Windows 10 Version 1903 and later. Re #5641. A note from Jamie Teh (Mozila): virtual desktop switch announcement works more effectively in Windows 10 Version 1903 (May 2019 Update) and later, therefore restrict virtual desktop announcement to that feature update and later. * Event handler/virtual desktop switch announcement and surrounding code: lint * Event handler/virtual desktop switch announcement: use formatted string literals when logging exceptions with execute event routine. * Event handler/virtual desktop switch announcement: add typing info for virtual desktop name field and handle possible desktop switch function. Re #5641 * Event handler/virtual desktop switch announcement: use a dedicated variable to detect Windows 10 1903 and later. Re #5641. In addition to placing winVersion module import at the top of the file, use a dedicated flag to indicate support for virtual desktop switch announcements in Windows 10 Version 1903 (May 2019 Update) and later. * Event handler: move virtual desktop constants to the top of the file. Reported by several testers: in some cases, NVDA fails to start due to type hint scope issue if a constant is placed between functions. Therefore, move virtual desktops handling to top fo the file next to other constants and data structures. * Event handler: lint (Flake8 ET126) * Event handler/virtual desktop announcements: make virtual desktop name and announcement check variables private. Re #5641. Reviewed by Sean Budd (NV Access): make virtual desktop name and can nanouncement virtual desktop name variables private - at the moment no add-on appears to need this functionality but this can change if requested by add-on authors. * update changes --------- Co-authored-by: Sean Budd <sean@nvaccess.org>
Author
Parents
Loading