Implemented correct handling of window resolution changes.