XWayland changes _NET_ACTIVE_WINDOW to None when focus switches to a Wayland window. This makes sure app window is deactivated in that case too and not just when focus changes to another X11 window.
_NET_ACTIVE_WINDOW also changes None when alt-tab is initiated, but there's no easy way to tell the difference, so this will also trigger a focus loss as soon as alt-tab is initiated, while we were previously waiting for it to actually complete to make changes.