ref #15 refine x11 window implementation based on msdn