Skip to content

Event handler: introduce virtual desktop announcement switch handling#14932

Merged
seanbudd merged 15 commits into
nvaccess:masterfrom
josephsl:i5641virtualDesktopAnnouncements
Jun 5, 2023
Merged

Event handler: introduce virtual desktop announcement switch handling#14932
seanbudd merged 15 commits into
nvaccess:masterfrom
josephsl:i5641virtualDesktopAnnouncements

Conversation

@josephsl

Copy link
Copy Markdown
Contributor

Note: this is take 3.1 of #5641 to see if a PR build can be built:

Link to issue number:

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.

Testing strategy:

Manual testing (prerequisites: Windows 10 or later):

  1. Press Control+Windows+D to open virtual desktops
  2. Switch between virtual desktops.
  3. Close a virtual desktop.

Known issues with pull request:

In some cases, closing a virtual desktop wil announce the focused control first and then announce virtual desktop name, but this is due to focus event firing before name change event.

Change log entries:

New features:

In Windows 10 May 2019 Update and later, NVDA can announe virtual desktop names when opening, changing, and closing them. (#5641)

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • Security precautions taken.

@josephsl josephsl requested a review from a team as a code owner May 18, 2023 08:07
@josephsl josephsl requested a review from michaelDCurran May 18, 2023 08:07
@josephsl josephsl changed the title I5641virtual desktop announcements Event handler: introduce virtual desktop announcmenep switch handling May 18, 2023
@josephsl

Copy link
Copy Markdown
Contributor Author

CC @seanbudd, @jcsteh, @michaelDCurran

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 4fdf563c3a

@seanbudd seanbudd changed the title Event handler: introduce virtual desktop announcmenep switch handling Event handler: introduce virtual desktop announcment switch handling May 31, 2023
@seanbudd seanbudd changed the title Event handler: introduce virtual desktop announcment switch handling Event handler: introduce virtual desktop announcement switch handling May 31, 2023

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @josephsl - the general approach here looks good

Comment thread source/eventHandler.py Outdated
Comment thread source/eventHandler.py
@josephsl

josephsl commented May 31, 2023 via email

Copy link
Copy Markdown
Contributor Author

@seanbudd

seanbudd commented Jun 1, 2023

Copy link
Copy Markdown
Member

Hi @josephsl - there are some strange artifacts in the diff here from other commits, including CLDR changes

@josephsl

josephsl commented Jun 1, 2023 via email

Copy link
Copy Markdown
Contributor Author

@CyrilleB79

Copy link
Copy Markdown
Contributor

Hi, when I did git pull origin master, it somehow did a rebase, and the CLDR commit artifacts came from git submodule update –init. Thanks.

I do not know how to explain this. Maybe you have something strange in your git config when doing git pull.

Anyway, no only the CLDR submodule but also the symbol files appear in the modified files of this PR. This should be fixed please. Thanks.

@josephsl

josephsl commented Jun 1, 2023 via email

Copy link
Copy Markdown
Contributor Author

josephsl added 12 commits June 1, 2023 16:09
… to handle possible virtual desktop switches. Re nvaccess#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.
…e event coming from CSRSS/desktop object and treat as a possible virtual desktop switch. Re nvaccess#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.
…irtual desktop switches after handling new foreground event. Re nvaccess#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.
… to Windows 10 Version 1903 and later. Re nvaccess#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.
…ng literals when logging exceptions with execute event routine.
…r virtual desktop name field and handle possible desktop switch function. Re nvaccess#5641
…riable to detect Windows 10 1903 and later. Re nvaccess#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.
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.
…e and announcement check variables private. Re nvaccess#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.
@XLTechie

XLTechie commented Jun 1, 2023 via email

Copy link
Copy Markdown
Collaborator

@josephsl josephsl force-pushed the i5641virtualDesktopAnnouncements branch from cd28d72 to c739942 Compare June 3, 2023 05:25
@josephsl

josephsl commented Jun 3, 2023

Copy link
Copy Markdown
Contributor Author

Should be resolved - did a force push as noted by a source from Luke's post above.

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @josephsl

@seanbudd seanbudd merged commit aa6b985 into nvaccess:master Jun 5, 2023
@nvaccessAuto nvaccessAuto added this to the 2023.2 milestone Jun 5, 2023
@josephsl josephsl deleted the i5641virtualDesktopAnnouncements branch June 5, 2023 05:14
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.

Windows 10: NVDA does not report which desktop I am on when I switch amongst multiple desktops

6 participants