x11: Manage windows after initial redirection
If there are existing windows when mutter starts to act as a compositing window manager, we'd first redirect those windows, then redirect subwindows. However when doing this, the subwindows redirection would fail, as it expected no previous windows to be redirected already.
This worked in the past because we previously had a "redirect all subwindows" call earlier, but with !2445 (merged) this accidentally changed, and broke starting with existing windows.
To fix this, switch the order so that we always redirect subwindows first, and only after that manage (and redirect) windows one by one.
Closes: #3089 (closed)
Marking as draft as I haven't tested if this fixes #3089 (closed) or not, but it does make mutter --x11
work again if I have an existing X11 client running on the corresponding X11 server. I don't know what commit in !2445 (merged) this fixes, so I didn't bother with a Fixes:
tag, since sadly !2445 (merged) doesn't manage to be bisectable.