Auto resize the main-window's size