VirtualDesktopAccessor icon indicating copy to clipboard operation
VirtualDesktopAccessor copied to clipboard

animation?

Open ondras opened this issue 5 years ago • 12 comments

Hi,

switching Desktops appears to be instant, as opposed to the nice "swipe" animation provided by the default ctrl+win+arrow implementation. Is it possible to maintain the animation when exposing the API?

ondras avatar Feb 06 '20 10:02 ondras

It's a good question, and I remember when I created this that I wanted that too.

However I don't see any setting to enable it, the function SwitchDesktop in the API does not take any parameters.

Ciantic avatar Feb 06 '20 10:02 Ciantic

@Ciantic okay, thanks for the explanation!

ondras avatar Feb 06 '20 11:02 ondras

Let's keep this open, maybe someone knows how to do it.

Ciantic avatar Feb 06 '20 11:02 Ciantic

This app seems to do animation as well...

ondras avatar Feb 06 '20 11:02 ondras

Hey thanks! More discoveries! SwitchDesktop actually does take parameter, according the code you gave, it's now doable.

However I'm a bit busy right now, but it should be doable from the code you gave.

Ciantic avatar Feb 06 '20 11:02 Ciantic

Oh noes, it doesn't look like it. They are calling the keyboard shortcut to "fake it".

Ciantic avatar Feb 06 '20 11:02 Ciantic

Cheaters! :)

(Well... pretty doable in AHK as well :smile:)

ondras avatar Feb 06 '20 11:02 ondras

There is a method in IVirtualDesktopManagerInternal that might allow us to get the animation:

IVirtualDesktopManagerInternal.SwitchDesktopWithAnimation(IVirtualDesktop desktop)

It has the same signature so it should work like a drop in replacement

IVirtualDesktopManagerInternal.SwitchDesktop(IVirtualDesktop desktop)

I haven't tested this but I plan to at some point.

mzomparelli avatar Oct 09 '23 22:10 mzomparelli

@mzomparelli thanks for updating, I see the Python script we now use outputs that.

I'm testing with that now on my animation feature branch https://github.com/Ciantic/VirtualDesktopAccessor/tree/feature/animation

It switches desktop that's for sure, but for some reason, I don't get the switch desktop animation. I don't get those animations even with Windows+Ctrl+Left/Right at the moment, so I can't verify if it works or not, something else might be broken on my Windows 11.

Ciantic avatar Oct 13 '23 21:10 Ciantic

I think the function isn't used anymore if this article is true.

Windows 11 may have removed the whole animation:

https://answers.microsoft.com/en-us/windows/forum/all/windows-11-virtual-desktop-animation/b5adac48-7c54-4fd4-8e5e-3e4adf3d3a26

I checked on Windows Insider Build and stable channel PCs, both do not have the switching animation. The last update was, Microsoft removed it:

https://blogs.windows.com/windows-insider/2021/...

We’ve turned off the animation when switching Desktops using the keyboard shortcuts as it was leading to flashes and hangs.

Ciantic avatar Oct 14 '23 09:10 Ciantic

For now at least it seems Windows 11 does offer a different function that uses animations when switching current virtual desktop. There are some extra methods in the COM interface IVirtualDesktopManagerInternal that needs to be added here.

I got it working in my virtual-desktop-manager-rs program that uses my fork of the winvd library. I also built a modified VirtualDesktopAccessor.dll that has an extra DLL function fn GoToDesktopNumberWithAnimation(desktop_number: i32) -> i32 that should switch desktop with an animation.

The animation works when I tested it on Windows 11 23H2 (OS Build 22631.4169).

Lej77 avatar Sep 15 '24 04:09 Lej77

@Lej77 I also have an old branch with that https://github.com/Ciantic/VirtualDesktopAccessor/tree/feature/animation

Last time I checked it didn't trigger animation but changed desktop normally without animation. I will try again when I come around to this.

Ciantic avatar Sep 22 '24 15:09 Ciantic