Better window resize behavior. Not perfect but close.