Can you give us some code to test?
Stefan's code. Load cl.el, then eval this:
(lexical-let ((f pop-up-frame-function))
(setq pop-up-frame-function
(lambda ()
(let ((win (selected-window)))
(unwind-protect
(funcall f)
(when (window-live-p win)
(select-window win)
(select-frame-set-input-focus (window-frame win))))))))
Then try `C-x 5 C-o' (`display-buffer-other-frame').
If the code works, it should make `display-buffer' (and so
`display-buffer-other-frame') use the redefined `pop-up-frame-function', which
should display the buffer without selecting it.
What I see instead is that the displayed buffer gets selected - its frame gets
the focus, which is not the intention.