Skip to content

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

Description

@pranavlal

NVDA does not report which desktop I am on when I switch among multiple desktops in windows 10 Professional. To duplicate this, do the following. From with windows 10:

  1. Get to the desktop with windows+d or to the task bar with windows+m.
  2. Hit windows+ctrl+d to create a new desktop.
    Note:
    You will not be told that a new desktop has been created. I believe sighted users do not get a notification either but there is reference to the "show desktop" button appearing.
  3. Use control+windows+right arrow to switch to the next desktop.

You will not hear any output from NVDA. I would expect NVDA to say something like desktop1, desktop 2 etc.
Note:
You can hit ctrl+windows+left arrow to switch to a previous desktop but NVDA will not speak which desktop I am on.

As regards the use case for such a notification:

  1. I may not remember what state I left that desktop in therefore it is handy to know that the desktop has changed.
  2. I may want to skip that desktop and go to another desktop so the notification will help with rapid navigation.

I am using windows 10 professional 64bit and NVDA 2015.4.

Activity

  1. jcsteh commented on Jan 3, 2016

    @jcsteh
    Contributor
  2. pranavlal commented on Jan 4, 2016

    @pranavlal
    Author

    Hi,

    See https://github.com/Ciantic/VirtualDesktopAccessor

    For a library that lets you access which desktop you are on. The trouble is that it asks for 64bit python.

  3. ehollig commented on Aug 16, 2017

    @ehollig
    Contributor

    Is there a way to get the name of the current desktop in Windows 10,1703? With Narrator, if I switch between desktop, Narrator correctly announces the name of the desktop. Example: Desktop 1, Desktop 2, etc. CC @jcsteh

  4. jcsteh commented on Aug 16, 2017

    @jcsteh
    Contributor

    Interesting. As far as I recall, Narrator didn't previously do this, so this is new if I'm correct. I still can't find any public APIs to get the current desktop name, nor can I see any way to do it with UIA (but that doesn't mean there isn't something I don't know about). They're possibly using the undocumented APIs used by the VirtualDesktopAccessor project linked above.

    I took a quick look at VirtualDesktopAccessor. It's all COM interfaces, so we could wrap them with Python comtypes with a bit of work. However, it's probably just easier to use the library. I'd prefer not to have a separate dll if possible, though we'd want to prefix the exported names from the dll if we built it into nvdaHelperLocalWin10. Note that the actual functions (even the code) are in dllmain.h.

  5. jcsteh commented on Apr 16, 2018

    @jcsteh
    Contributor

    You can now get the name of the desktop using IAccessible (or presumably UIA). It's exposed as the name of the desktop window. It also fires a nameChange event when it changes.

    The tricky part is how to map this in NVDA. We choose to only use a Window NVDAObject for the desktop window, as we don't want to deal with the client IAccessible. To work around that, we can either implement an IAccessible overlay to capture the nameChange event or special case the desktop nameChange event in IAccessibleHandler. No big deal. The problem is that if there is a foreground change (which there often is, but not always), the desktop name gets silenced before it can speak because we cancel speech for foreground events. To make matters more confusing, there won't be a foreground event if switching desktops ends up keeping you in the same app, which can happen if you were focused on the desktop itself (e.g. Windows+m in both desktops).

    We could re-visit the cancelSpeech in event_foreground, but that's probably risky. Otherwise, I guess we'll have to special case this somehow in eventHandler. My original thought was to have the event that reports the desktop change get executed after the foreground event. It feels pretty weird to fire a desktop change event after foreground, though. Perhaps a better idea is to set things up so that event_foreground always fires for desktop changes and it handles the desktop name change if there was one.

  6. added this to the 2019.2 milestone on May 22, 2019
  7. reopened this on Apr 19, 2020
  8. jcsteh commented on Apr 19, 2020

    @jcsteh
    Contributor

    Reopening, since this was reverted (#9629) before it ever got into the release.

  9. removed this from the 2019.2 milestone on Apr 19, 2020
  10. jcsteh commented on Apr 19, 2020

    @jcsteh
    Contributor

    I suspect the reason #8259 was causing problems for some users is that even though we were disabling the change handling for <= Windows 10 May 2019, the Desktop IAccessible object's name property still would have called accName on the Desktop IAccessible. That means we probably could have called it in some cases, even on Windows 10 builds where this caused freezes. I'm going to submit a revised PR which deals with this.

  11. marrie commented on Jan 31, 2022

    @marrie

    You can now rename desktops by right clicking on said desktop. Problem: nvda does not read the name of the desktops you are on. I hear "desktop 1, desktop 2, etc.

    1. launch a virtual desktop with win control D.
    2. you will hear desktop 2 in my case.
    3. navigate back and forth with win control left and right.
    4. you will hear "desktop 1, desktop 2"
    5. navigate to the task bar with win plus t
    6. shift tab and click the show task view button
    7. navigate to the desktops button
    8. click the show desktops button.
    9. now right click the desktops and you will see a rename desktop item.
      This is when NVDA does not read the names of the desktops you set up. I could have a work desktop and a streaming desktop but they will be called desktop 1 and desktop 2 respectively.
  12. josephsl commented on Jan 31, 2022

    @josephsl
    Contributor
  13. 13 remaining items

  14. added a commit that references this issue on Jun 5, 2023
    aa6b985
  15. added this to the 2023.2 milestone on Jun 5, 2023
  16. ondrosik commented on Jul 2, 2023

    @ondrosik
    Contributor

    Now NVDA reports the desktop name before focused window what is little annoiyng for me. I prefer to hear focused window first. BTW note that on Windows 11 it works as I expectd - first focused window, then focused desktop. Do you think that current state is better?

  17. josephsl commented on Jul 2, 2023

    @josephsl
    Contributor

    Hi,

    Virtual desktop switch event is raised not by desktop but rather by Windows itself, specifically a part of Windows that controls user interface display and related functions. in fact, as soon as one presses Control+Windows+left/right arrow, virtual desktop name change event is received by NVDA, and then focus and foreground change events occur. This is actually what causes NVDA (and Narrator) to announce virtual desktop names before focused control name, and this happens on both Windows 10 and 11.

    I think the experience you are referring to came about thanks to Windows App Essentials add-on. Starting from version 23.06, Windows App Essentials add-on closely resembles NVDA 2023.2 - it will announce virtual desktop name before focused control, which follows the event flow described above. So in some ways, what NVDA does could be considered correct behavior (of course some event sequences can cause problems, so developers must think about balancing things).

    Hope this helps. Thanks.

  18. XLTechie commented on Jul 2, 2023

    @XLTechie
    Collaborator
  19. marrie commented on Jul 2, 2023

    @marrie
  20. ondrosik commented on Jul 4, 2023

    @ondrosik
    Contributor

    I understand the logic behind it, it is probably my personal preference to not hear the desktop number first, because I know how I am organized and I mostly want to hear the focused window first. Currently in latest snapshots I press nvda+t to quickly hear the focused window. I noticed that narrator does this too, the info about win 11 is from another person, I will werifi that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/windows-interfaceInteractions between NVDA and the default Windows GUI

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions