fix condition to restore window position when unmaximized