You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows 10: NVDA does not report which desktop I am on when I switch amongst multiple desktops #5641
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:
Get to the desktop with windows+d or to the task bar with windows+m.
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.
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:
I may not remember what state I left that desktop in therefore it is handy to know that the desktop has changed.
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.
It's worth noting that sighted users don't really get any indication
either, certainly not of the name of the desktop. My understanding is
taht this annoys a lot of sighted users too. They can see the Taskbar
change and the visible windows if any. So, if they had similar stuff
open on two desktops, it'll be difficult for them to see what desktop
they're on when they switch. Still, the argument that it's easier for a
sighted user to see what's changed at a glance is valid.
Unfortunately, regardless of any principle/philosophical arguments,
there doesn't appear to be any way in Windows to get the name of the
current desktop, at least not that I've been able to find. Until there
is, this is not possible.
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
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.
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.
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.
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.
launch a virtual desktop with win control D.
you will hear desktop 2 in my case.
navigate back and forth with win control left and right.
you will hear "desktop 1, desktop 2"
navigate to the task bar with win plus t
shift tab and click the show task view button
navigate to the desktops button
click the show desktops button.
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.
Hi, when I do rename virtual desktops and switch amongst them, I do hear the new virtual desktop name. I’m assuming this issue is present wih Windows App Essentials add-on installed? If yes, I canont reproduce this. Thanks.
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?
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).
For what it's worth, most reports I have heard (including my own), prefer to
hear the desktop first.
But of course with all such things, there are always others who prefer something
else.
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.
Activity
jcsteh commentedon Jan 3, 2016
pranavlal commentedon Jan 4, 2016
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.
ehollig commentedon Aug 16, 2017
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
jcsteh commentedon Aug 16, 2017
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.
jcsteh commentedon Apr 16, 2018
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.
jcsteh commentedon Apr 19, 2020
Reopening, since this was reverted (#9629) before it ever got into the release.
jcsteh commentedon Apr 19, 2020
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.
NVDAObjects.IAccessible.Desktop: use newer NVDA API. Re nvaccess#5641.
marrie commentedon Jan 31, 2022
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.
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.
josephsl commentedon Jan 31, 2022
13 remaining items
Event handler/virtual desktops announcement: use a dedicated function…
Event handler/virtual desktop switch announcements: detect name chang…
Event handler/virtual desktop switch announcements: handle possible v…
Event handler/virtual desktop switch announcement: limit announcement…
Event handler/virtual desktop switch announcement: add typing info fo…
Event handler/virtual desktop switch announcement: use a dedicated va…
Event handler/virtual desktop announcements: make virtual desktop nam…
Event handler: introduce virtual desktop announcement switch handling (…
ondrosik commentedon Jul 2, 2023
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?
josephsl commentedon Jul 2, 2023
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.
XLTechie commentedon Jul 2, 2023
marrie commentedon Jul 2, 2023
ondrosik commentedon Jul 4, 2023
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.