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

  1. 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`.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.