VirtualDesktopAccessor icon indicating copy to clipboard operation
VirtualDesktopAccessor copied to clipboard

Switching desktop occasionally causes app icons to flash in the task bar

Open mid-kid opened this issue 1 year ago • 3 comments

What it says on the tin. When I press one of the autohotkey shortcuts (with the default script) to switch desktops, occasionally, an application icon in the taskbar will start flashing a notification, until I manually click it. It won't focus the proper window until I do so. This makes this desktop switching method borderline unusable, unfortunately, but I'm not sure if it's something to do with my setup.

Windows 11 24H2, AutoHotkey version 2.0.19. Script slightly modified, and attached.

VirtualDesktopAccessor.ahk.txt

mid-kid avatar Feb 20 '25 11:02 mid-kid

I remember having those issues even in Windows 10.

Windows 11 has this thing:

Image

If you for some reason like flashing taskbar buttons, you can try to activate a desktop just before switching a desktop, I remember this helped when I still used flashing taskbar buttons, which is very long time ago.

Ciantic avatar Feb 20 '25 20:02 Ciantic

Thanks! While that works, I've figured out what the bigger problem is: the topmost window doesn't get focussed, which means that I can't keep typing when I'd like to. I have to pick up the mouse and re-focus the window. The annoying part is that this doesn't happen always, so it's easy to get carried away thinking the appropriate window is focussed, but that's only right half of the time...

mid-kid avatar Mar 12 '25 10:03 mid-kid

Thanks! While that works, I've figured out what the bigger problem is: the topmost window doesn't get focussed, which means that I can't keep typing when I'd like to. I have to pick up the mouse and re-focus the window. The annoying part is that this doesn't happen always, so it's easy to get carried away thinking the appropriate window is focussed, but that's only right half of the time...

Yeah this is also known problem in Windows Virtual Desktop API.

You can also make a workaround for that, see this comment:

https://github.com/Ciantic/VirtualDesktopAccessor/issues/77#issuecomment-1762913790

I prefer to keep the functionality in the DLL simple, but implementing a "fix" for that is doable in AHK.

Ciantic avatar Mar 14 '25 19:03 Ciantic