unmaximize before setting resolution