winex11: Move the support for making the owner window managed to a separate function.