Reproduction steps:
1. Open the attached project "ReproProj"
2. Click on the Scene View window and press “P“ on the keyboard to enable the Brush tool
3. Press down the left mouse button on the Scene View window and hold it, observe that “EventType.MouseDown 11” appears in the Console window
4. Release the left mouse button and observe that “EventType.MouseUp 834972938” appears in the Console window
5. Press down the left mouse button and drag in the Scene View window, observe that “Currently dragging?: True“ appears in the Console window
6. Press down the left mouse button and drag to the Editor’s Menu Bar and then release it. Notice that instead of the “EventType.MouseUp 834972938” appearing in the Console, there is “EventType.Ignore 834972938” and “EventType.MouseLeaveWindow 0”
7. Try hovering over the Scene View window without pressing anything and observe the Console window
Expected result: When releasing a button outside of the Scene View window the Editor detects it and then when hovering over the Scene View window without pressing anything it should show “Currently dragging?: False”
Actual result: The time in brackets of the “Currently dragging?: True” message in the Console window is updating
Reproducible with: 2020.3.48f1, 2021.3.24f1, 2022.2.18f1, 2023.1.0b15, 2023.2.0a13
Reproducible on: Windows 10 Enterprise 21H2
Notes:
- I believe some of Unity's toolbar code calls the .Use() on the event, even though the GUIUtility.hotControl is set ti users id: 834972938
- There doesn't seem to be a proper way to detect a MouseUp event to stop BrushTool from continuing, to set dragging to false correctly, without testing if Event.current.type == EventType.Ignore which is a terrible workaround