I'm on Archlinux, and since the last update of the package xfwm4 from version 4.6.1 to 4.6.2 wmctrl -a doesn't work as expected anymore.
According to wmctrl man page:
Switch to the desktop containing the window <WIN>, raise the window, and give it focus.
On 4.6.1 it gives focus.
On 4.6.2 it only raises WIN but don't give the focus. The focus is still on the window under the mouse (I have focus follow the mouse on)
I think the focus should change only on mouse entering a window and not stay only on the window currently under the mouse.
works now on 4.8