RadAd / RMVirtualDesktop

Virtual desktop functionality for Rainmeter
MIT License
19 stars 3 forks source link

Error, plugin doesn't work :( #4

Closed rogor closed 10 months ago

rogor commented 10 months ago

Hi,

I've tried to use this plugin, but I cannot get it to work. The desktop number stays on 0, and the buttons don't work on the demo skin. I'm on Windows 11.

I've enabling logging to see if I get an error, and I get his on every refresh: ERRO (11:31:49.615) VirtualDesktopDemo\VirtualDesktop\VirtualDesktop.ini - [MeasureVirtualDesktop]: GetDesktopManagerInternal

Any ideas? Thanks!

RadAd commented 10 months ago

That error means it couldn't create the IVirtualDesktopManagerInternal object. These are undocumented details and Microsoft occasionally changes the details.

What is in the registry under HKEY_CLASSES_ROOT\Interface{B2F925B9-5A0F-4D2E-9F4D-2B1507593C10}?

If nothing is there search the registry for IVirtualDesktopManagerInternal.

rogor commented 10 months ago

There is nothing like this in my registry. I even did a search for just VirtualDesktopManager and it didn't find anything.

I did find where the virtual desktops IDs are stored and which one is currently selected, but I'm not sure whether that's of any use to you: Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops image

RadAd commented 10 months ago

Those are for the virtual desktops that you have created.

I'm not currently using Windows 11.

Do you know which version of Windows 11 you have? Run 'winver'.

rogor commented 10 months ago

Version 22H2 (OS Build 22621.2428).

I looked around for a program that was doing something similar to see if I could find something to help, and I found this one: https://github.com/dankrusi/WindowsVirtualDesktopHelper Maybe you can look at how they did it, since it does work on Windows 11. From looking at their issues, it does seem to break occasionally with Windows updates as well. It displays the virtual desktop number in the taskbar, which is similar to what I wanted to do with your plugin, so I'll use that instead for now.

RadAd commented 10 months ago

It looks like Win11 23H2 has changed some GUIDs.

Also, they have changed the function signatures to remove support for per monitor virtual desktop support.

Try this and tell me if it works: VirtualDesktop.zip

rogor commented 10 months ago

There is progress :) The prev/next buttons on the demo skin work, but the displayed number and colored squares don't update unless I manually refresh the skin.

I'm also getting this in the log when I refresh: NOTE (11:38:44.672) VirtualDesktopDemo\VirtualDesktop\VirtualDesktop.ini: Refreshing skin ERRO (11:38:44.678) VirtualDesktopDemo\VirtualDesktop\VirtualDesktop.ini - [MeasureVirtualDesktop]: Register DesktopNotificationService 0x80004002 ERRO (11:38:44.680) VirtualDesktopDemo\VirtualDesktop\VirtualDesktop.ini - [MeasureVirtualDesktopCount]: Register DesktopNotificationService 0x80004002

RadAd commented 10 months ago

Looks like DesktopNotificationService has also changed. That other project you linked doesn't use that interface.

Are you able to get the new interface for me?

I use this tool: https://github.com/tyranid/oleviewdotnet

image

Select "Registry" -> "Interfaces by Name" from the menu. Use the filter to find "DesktopNotificationService".

image

Right click on the interface and select "View Proxy Definition":

image

Then copy and past the text on the right side. You should get something like this:

[Guid("0cd45e71-d927-4f15-8b0a-8fef525337bf")]
interface IVirtualDesktopNotificationService : IUnknown {
    HRESULT Proc3(/* Stack Offset: 8 */ [In] IVirtualDesktopNotification* p0, /* Stack Offset: 16 */ [Out] int* p1);
    HRESULT Proc4(/* Stack Offset: 8 */ [In] int p0);
}
rogor commented 10 months ago

Unfortunately, I also get nothing when searching for the interface (I tried searching for multiple combinations of virtual/desktop/notification): image

I just noticed that Windows update tells me I can update to version 23H2. Is there anything else you want me to try while I'm on 22H2, or should I update and see if anything changed?

RadAd commented 10 months ago

Not to worry. Thanks for trying.

Update yours. I will need to try this on the latest anyway.

rogor commented 10 months ago

I just did the update, the problems are the same. Still no interface.

There is now (finally) a popup and animation that tells you which desktop you switched to when you switch between virtual desktops (example here). That was the main thing missing from Windows 11 that made me download your plugin, I wanted a way to keep track of which virtual desktop I was on :P

The buttons on your demo skin still work, but they bypass the animation, so you get an instant switch (you still get the popup).

RadAd commented 10 months ago

I think I have found the updated interface details, hopefully, they are correct.

Could you please try this version: VirtualDesktop.zip

rogor commented 10 months ago

Indeed, it works perfectly! Thank you!

RadAd commented 10 months ago

Thats great.

There is a new function in these new Win11 23H2 APIs called "SwitchDesktopWithAnimation".

I'm assuming this will show the animation now while switching desktop. Could you please try out this version:

VirtualDesktop.zip

rogor commented 10 months ago

Yes, this works and shows the animation. After using both I find that I actually prefer the instant switch without the animation, it's quicker :)

RadAd commented 10 months ago

I have backed out the switch with animation and updated a new version to the releases.