c563a1f251
We assumed that a window will be ready after a single roundtrip but that's actually not guaranteed by the XDG shell protocol. This patch waits for an arbitrary timeout (10s) before erroring out and forcefully closing the window. Since this exercised quite some code paths, it also reworks some window handling logic and fixes a bunch of synchronization issues. (cherry picked from commit eb680bc8c3e4a811dc8736716fd9cf57567c21dd)