relayout main window