Open munael opened 3 years ago
I have been debugging, and found that the problem seems to be when SwapDesktops calls GetAllWindows (see relevant code below).
The problem is that GetAllWindows returns all windows (correctly) but includes a strange window from an application I have installed called Alt-Tab Terminator. This particular window generates an error on line 46, when the code calls MoveToDesktop. The image below shows this window (handle number 00010338, which I discovered by adding a LoggingService call on line 46) as seen on Spy++ (tool included in Visual Studio)
From the image, note that 10338 is owned by another window (30298), and 30298 is not returned by GetAllWindows (I don't know whether this is right or wrong, just noticed it).
10338 is always the first window listed by GetAllWindows (at least on my tests, maybe GetAllWindows lists them in ascending order of handle number...). So I tried to modify the code such that the first window in variable srcWindows
would be skipped, and the code worked again (all the other windows were switched from one desktop to another, i.e. the swap feature worked).
Haven't used window swapping specifically since a long while ago. Tried using it again today (got 7 virtual desktops with around 150 windows total). Doesn't work no matter what shortcut I assign. Neither when restarting.
Throughout that period, only things I can think of that changed are:
Disabling each of those 3 still doesn't fix it :(