Raising a window should not give it input focus
According to the documentation here,
The XRaiseWindow function raises the specified window to the top of the stack so that no sibling window obscures it. If the windows are regarded as overlapping sheets of paper stacked on a desk, then raising a window is analogous to moving the sheet to the top of the stack but leaving its x and y location on the desk constant. Raising a mapped window may generate Expose events for the window and any mapped subwindows that were formerly obscured.
The documentation does not suggest that said window should receive focus. There is a separate function for that, XSetInputFocus. I believe xfwm4 does not follow this protocol. This issue has risen following a discussion about misbehavior of emacs. See the discussion here.
If you want to maintain this behavior, perhaps there should be an option in the window manager settings, e.g., when a window raises itself, automatically give it focus.
To reproduce this bug, disable "Activate focus stealing prevention" in window manager tweaks and open a text editor. I am using xed here. Then, run the following command
xdotool windowraise $(xdotool search --onlyvisible --class "^xed$")
You will notice that the text editor has input focus, meaning typing will appear in the text editor. What I expected to see is the text editor appearing on top, but input focus should remain in the terminal. I hope this makes sense.