Better mgmt of window resize