Reordered the operations when recomputing the tray layout, in order to minimize the amount of time between positioning an actual window and redrawing.