Reproduction steps:
1. Open the “EmptyProject” or any Unity project
2. Open Build Settings
3. Click the “Player Settings” button
4. Close Player Settings
5. Close Build Settings
Expected result: the Editor remains in focus
Actual result: the last opened external application (e.g. Unity Hub) is in focus
Reproduced in: 2023.1.0b1, 2023.1.0b5, 2023.2.0a1, 2023.2.0a3
Not reproduced in: 2020.3.45f1, 2021.3.19f1, 2022.2.7f1, 2023.1.0a26
Reproduced using: Windows 10, Windows 11
Not reproduced using: macOS 13.0.1 (Intel)
Note: also reproduced when closing Build Settings before Player Settings