V7 - Wait until Window has loaded

I need to popup a window (W2), in front of the currently opening window (W1) programatically, BUT only once W1 has loaded and is available via UI.getCurrent(). Is there an onLoad or similar i can use to achieve this as right now, its appearing behind my window (i can only assume UI.getCurrent is using the window in the background)?

I’m not sure exactly, but Window has the method addAttachListener that could work.