Saving main window state to config.