Merge "Make the condition of preserveWindows consistent" into main