Handle dynamic window resize