Fix bug resize the window.