fixed use parent as containment; applied position update when the window...

fixed use parent as containment; applied position update when the window is changed;

I need more time to test and make sure it is ok. Can you help me?

But apparently it is correct.