Auto-resize window when user change current view