I find a bit surprising that changing a window parent would activate it (actually, activate its parent?).
There was a discussion elsewhere, about whether the standalone systray window should be created with WS_EX_NOACTIVATE, to avoid it stealing focus (although I believe winex11 has trouble handling NOACTIVATE anyway), would that be enough? Maybe it should be the same for the icons?
Do you have a specific scenario where this happens? Is this with the taskbar or with the standalone systray?
Regarding the layered windows, I think it should be able to draw layered windows regardless of whether they are in the host dock or not?