Using xdotool was probably a little less portable, because it relied on the newly created window to be activated by the window manager.