More readable version of window resizing, still some missizing on my
windows machine though.