Switching desktop occasionally causes app icons to flash in the task bar
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.
I remember having those issues even in Windows 10.
Windows 11 has this thing:
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.
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...
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.