Reordered some commands to minimize redraws

The changes have no effect in Mutter (which redraws quite often
regardless of them), xfwm4 and kwin (who do no unnecessary redraws
anyway) and Windows builds. But they prevent i3 from resizing the window
before we do, which prevents a redraw there.