godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.79k stars 20.13k forks source link

Editor viewport hotkeys don't work when property inspector has focus #95607

Open wagnerfs opened 3 weeks ago

wagnerfs commented 3 weeks ago

Tested versions

System information

Windows 10 - Godot 4.3.stable - Vulkan (Forward+)

Issue description

None of the viewport hotkeys (like Numpad_1, Numpad_3, F) work when anything on the property inspector has focus.

image

The issue seems to be related viewport not gaining focus once the mouse has left the inspector panel towards the viewport, on 4.2 the view would automatically gain focus as soon as the mouse is over it

Steps to reproduce

Minimal reproduction project (MRP)

N/A

AThousandShips commented 3 weeks ago

I'd say this is desired, I wouldn't want or expect the viewport to update when focused in the inspector, I'd consider that a bug rather

wagnerfs commented 3 weeks ago

@AThousandShips can't agree, you have to basically click the viewport to be able to change angles for example, that quickly becomes counterproductive when you just want to update inspector values like position using the mouse or a specific typed in value, let's say, to try and center a MeshInstance3D to the origin, then having to click back to the view, most likely deselect the said MeshInstace3D and lose the entire inspector you were fiddling with just a second ago.

On top of that, since the auto focus isn't working on 4.3, clicking on the MeshIsntance3D on the scene tree view won't focus the view either, which means you'd STILL need to click on the view to be able to change angles or doing any hotkeys, and again, unless you had to precisely click on said MeshInstance3D within the view (that surely won't scale well on large scenes), you'd most likely deselect the node again.

Not only that has been a thing through all past Godot releases, but I can also take Blender as example here, the hotkeys available are the ones available for the panel your mouse is over

AThousandShips commented 3 weeks ago

Since it changed between 4.2 and 4.3 it'd be important to identify when it was changed, will try identify it, and from there there would be two paths:

Will respond when I've found when this was changed

Calinou commented 3 weeks ago

@wagnerfs Can you try following the same steps on 4.3 dev/beta/RCs to determine when the regression started? You can download them here.

wagnerfs commented 3 weeks ago

@Calinou just tested, RC1 was the one that broke it, Dev6 was working fine.

matheusmdx commented 3 weeks ago

Bisecting points to #93165 as the culprit:

image


IMO this is not a big problem because you just need to do a left mouse click on the view area to make works again (u already had to move the mouse to the view area anyways)

wagnerfs commented 3 weeks ago

@matheusmdx if you talk only about the focus then absolutely, only a click away, productivity wise it's a mess, I've explained it here though: https://github.com/godotengine/godot/issues/95607#issuecomment-2293425305

wagnerfs commented 6 days ago

I got a bit of time to check that PR and indeed, that was the issue, I managed to get it fixed by instead of having EditorSpinSlider::is_text_field always returning true, change the return to value_input_popup && value_input_popup->is_visible(); since it's when and only when the spin field has "become" a text field, so it doesn't rollback that PR at all.

https://github.com/user-attachments/assets/50c2cb32-a094-40bb-9a5b-6d67656eb430

I'll probably get a PR with the fix ready when I get some free time.