The window that Liesl comes in is a different one. If you watch carefully you will notice the window that Maria closes is at the head of her bed. When Liesl comes in, it is through a window at the foot of Maria's bed.
Say it with me... storm. There is a storm raging outside and that is how they, (the kids), all end up in Maria's room. There is a HUGE clap of thunder which opens Maria's windows. The storm also opens her windows at least two-three more times. :)
Actually, there were three different windows that they've closed, the first one was the one that Maria closed before Frau Schmidt entered, (if you were lying in the bed, it would be in your back-left side), the second one was the one Frau Schmidt closed (that is in your back-right side, the one close to the cabinet) and the third one is the one that Maria closed after Leisl came in (that is in the left side of the bed)
Someone (no, literally, the person named 'Someone') asked how the window could be at the foot of the bed when the bed was in the middle of the room. Well, I just want to say there is a way. If they get a camera shot lining up the bed and the window, there's no wa y to tell the distance of the bed and window from that shot.