Steps to reproduce:
1. Open a new Unity project
2. Once the project is loaded, open another non-Unity window and keep it in focus
3. Move and resize the non-Unity window so that the Editor's Hierarchy window isn't blocked
4. Without focusing back on the Editor window, right-click a GameObject in the Hierarchy window and select the "Rename" option
5. With left-click, focus back on the Editor window
6. Observe the "Renamed" GameObject in the Hierarchy window
Expected result: The context menu options are either a) disabled if the Editor window is not in focus, or b) they focus the Editor window once selected, and are executed afterwards
Actual result: The context menu options are enabled, and do not focus the Editor if selected. The selected action(s) are executed right after the Editor window is manually refocused.
Reproducible with: 2020.3.44f1, 2021.3.18f1, 2022.2.5f1, 2023.1.0b2
Tested on: macOS Monterey 12.0.1
Note: This issue reproduces with the "Rename", "Duplicate", and "Delete" context menu options. It also appears that these actions can be queued up, in which case they are executed all at once, once your focus back on the Editor window.