Search Issue Tracker
By Design
Votes
1
Found in
2020.3.36f1
2021.3.5f1
2022.1.7f1
2022.2.0a17
2023.1.0a2
Issue ID
UUM-8041
Regression
No
EditorWindow.hasFocus always returns true
To reproduce:
1. Open the project “EditorWindowHasFocusBug”
2. Open the EditorWindowImpl window (Bug Report → Open Test Window)
3. Stop focusing EditorWindow (e.g., click somewhere on your desktop)
Expected result: All three methods return false
Actual result: Method “hasFocus” returns true
Reproducible with: 2020.3.36f1, 2021.3.5f1, 2022.1.7f1, 2022.2.0a17, 2023.1.0a2
Reproduced on: macOS Monterey 12.4 (Intel)
Note: The script is Assets → Scripts → Editor → EditorWindowImpl.cs
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "One or more data file missing for baking set NewScene Baking Set. Cannot load shared data." error in Player when a specific project is built
- Choosing new HDR Colour using RGB values breaks colour on Intensity Selectors
- Rendering/Decal Layer Mask options are different inside Prefab Mode and outside Prefab Mode when the project is upgraded to Unity 6
- Incorrect Realtime GI Light Probes baking when more than one Light Probe Group is used and "Baked Global Illumination" is enabled
- Hovering on the three-dot menu also highlights the tab header near it when not all tabs fit the bar
Resolution Note:
We agree that the name `hasFocus` is not the most intuitive, however it behaves as expected. `myWindow.hasFocus` means that this is the visible window within a docking area, even if it doesn't have event focus. To know what `EditorWindow` has the event focus, please use `EditorWindow.focusedWindow`.