m0ngr31 / VirtualDesktopManager

383 stars 79 forks source link

Crashes on tray icon mouseover - windows 11 #45

Open cyberponk opened 2 years ago

cyberponk commented 2 years ago

Hi I am trying to use VirtualDesktopManager on windows 11 and it crashes as soon as I hover the mouse on the tray icon.

LuLu69 commented 2 years ago

Hi, same to me. Moreover: VirtualDesktopManager does not work at all on Win11. Is there anyone out there to make this very helpfull tool working again?

iskmz commented 2 years ago

I've been working on my fork of this tool since February : iskmz/VirtualDesktopManager , and understood few things about its "inner workings"

a suggestion: basically, this tool depends on two main repositories: GlobalHotKey & VirtualDesktop which are included as NuGet packages. VirtualDesktop was updated to work for Windows11 , but this tool uses version 2.0.0-beta3 of it , while the latest is 5.0.5

so download the source (clone) -> open in visual studio -> in the solution explorer (usually to the right) Right-click references -> choose "Manage Nuget Packages" : there you can update VirtualDesktop to the latest, but BEWARE that it needs at least .Net framework 5.0 update, and will limit working version of win10 to 20H1 at minimum (not for any previous version) , also it might need to adapt the source code to the new updated VirtualDesktop.dll (not sure about this one) ...

Anyways, I didn't update it for now, because I don't have a Win11 capable device, and cannot check it ... but I might, in the future, release a parallel version with the updated VirtualDesktop ...

iskmz commented 2 years ago

took me a couple of days to do what I mentioned above; was not that easy to adapt to .net-core-5, because need to make some changes to code for it to work.

but here it is: v2.4.1_w11--beta1 !!

NOTE: that it was NOT tested on windows11 (don't have one) , but I believe it should work.

would love your feedback to get a sense of its working condition [or crashing condition 😎] or , if it works partially , then what are the errors and when do they appear (after which events)

waldimen commented 1 year ago

It does not work on Windows 11 22H2 it crashes on VirtualDesktop.GetDesktops() with exception

System.Collections.Generic.KeyNotFoundException: 'The given key 'IApplicationView' was not present in the dictionary.'

iskmz commented 1 year ago

@waldimen (Or anyone who tested it) Does it work on previous versions of win11 ? Before the 22H2 update ? Cause if it is so, then it seems that the last update changed the keys that Virtual Desktop uses .. and since it is yet to be updated then there's nothing I can do to fix it ... any suggestions ? NOTE: that there are suggested fixes here & here


however, If the error happened for an earlier win11 version then the problem is deeper and perhaps I should install win11 on a VM or something to check things out .. but have no time recently ...

plhjd commented 1 year ago

I'm using windows 11 22H2 and I had the same problem, to solve it without having to change the repository I used the source of this pull request that was suggested here and compiled VirtualDesktop.dll, and replaced the compiled one on VirtualDesktopManager .exe folder. It was necessary to use the fork of @iskmz. Thanks @iskmz for the project migration.

iskmz commented 1 year ago

thanks @plhjd for your response could you please upload the compiled VirtualDesktop.dll here so I can add it to the repository ?

plhjd commented 1 year ago

VirtualDesktop.zip @iskmz I uploaded it but maybe it's not ideal to put it in the repository, in the same pull request there are comments that it didn't work on some versions of Windows 10. I imagine it's a partial fix just to work on Windows 11.

iskmz commented 1 year ago

@plhjd Thanks again for the quick response. I'll simply add it to the README as an extra "patch" or something to download as a fix for win11 22H2. Won't make any changes to the repo besides the readme file.