Added support for window resize and view movement