Fix child windows may reside on other layers than parent.

Child windows should reside on the same layer as parent.