Stabilize Virtual Desktop API
Currently there's a set of COM APIs, that provide access to Virtual Desktop-related features, like pinning apps to desktops, switching desktops, etc. Unfortunately, most of it is undocumented, and does not seem to be stabilized (2018 Spring Update for instance changed IApplicationView's CLSID, so apps using it stopped working).
per before, can you make a clear scenario based request?
“I want to do XYZ, currently the api set only allows ABC, if we had apis to do M, N, and P, we feel we could accomplish XYZ.”
mrcat meow commented
Speaking of virtual desktops, I hate how slow task view has been since 1803.
Scott McKay commented
I use https://github.com/sdias/win-10-virtual-desktop-enhancer (which uses https://github.com/Ciantic/VirtualDesktopAccessor to allow setting up keyboard shortcuts to do various operations). That uses the undocumented API to provide way better keyboard shortcuts for managing virtual desktops.
For example, I use Ctrl+Alt+[1-6] to switch directly to one of the 6 virtual desktops I have.
Ctrl+Shift+[1-6] to move the current app to a specific virtual desktop.
Ctrl+Shift+Alt+A to pin an App
Ctrl+Shift+Alt+W to pin a Window.
The tray icon also displays the current virtual desktop number.
These are way faster than doing things via the GUI.
Would be better if the ability to set these keyboard shortcuts was built-in.
10.0.17763 broke moving an app to a different virtual desktop and displaying the current desktop in the tray icon due to changes in ids and api/s.
I should add I would be quite happy for this all not to be in an API if windows supported / fixed the use cases I have given
People go to the effort of working out what is in undocumented APIs for a reason :) Basically that reason is the windows implementation of virtual desktops is very limited compared to what people who like them are used to from other environments. Those who aren't used to them aren't likely to use them anyway! And then windows does some weird things when opening new documents/urls...
My scenarios that https://sourceforge.net/projects/virtual-desktop-grid-switcher/ implements using this API:
1. I want to move my current window to another desktop using a keyboard shortcut (that I can configure myself)
2. I want to arrange my desktops in a 2-D grid layout instead of a long 1-D line so that getting from desktop 1 to desktop 9 does not require 9 steps when thinking of them as layed out in a visual space and using a keyboard shortcut to switch to the adjacent desktop (shortcut that I can configure myself).
3. When I click a URL that opens a browser window/tab I do not expect my current desktop to change to a different desktop if there is a browser window open on the current desktop (which it does if the most recently used browser window is on a different desktop). Therefore every time the desktop is changed I need to activate the browser window on that desktop.
4. When I open a microsoft office document or a pdf document from windows explorer I do not expect my current desktop to change to a different desktop which it does because these operations usually switch to an existing open office program window and open another window on the same desktop. Therefore I need to detect this happening and move the window back to the desktop I was on.
As many people are complaining about here:
Michael Zomparelli commented
As far as I can tell in 17661, only IApplicationView and IApplicationViewCollection have changed. Even pinning windows appears unchanged. I have the 17661 interfaces posted in my GitHub issue.
Here's one of my specific scenarios: I am making a tiling window manager, that supports grouping windows into tabs. When user moves a window (third party for me) from the current desktop to some other desktop, I need to hide its tab on the current desktop. For that I need to:
1. be notified when window changes desktop. Currently, I resort to polling all windows using timer and IVirtualDesktopManager.GetWindowDesktopId
2. be notified when user switches desktop to refresh layouts and render manager specific animations. Alternatively, I need to know when a new desktop is created/deleted so instead of refreshing my UI I could create an instance of UI per desktop (less efficient though). Currently, I am using undocumented IVirtualDesktopNotification interface. That functionality is breaking in 17661, because IVirtualDesktop, that is passes to the callback changed CLSID too.
Michael Zomparelli commented
I'm voting for this.
From 1709 to 1803 IApplicationView has a new CLSID. It also removed 3 procedures and added 4 new ones. I don't have the names for the new procedures so it would be helpful if this were documented properly. See the new interface declaration in the following link.
In my case that was trying to track which desktop a third party window belongs to.