Main window position restored (fix #996)