Fix "prepare-xwindow-id" management.
More doctest.