Almost working window resize on the fly