godotengine / godotengine/godot
_gui_input is not propagated to parent for keyboard and joy inputs
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Tested in 4.3.stable
### System information
Godot v4.3.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 with Max-Q Design (NVIDIA; 31.0.15.5123) - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 Threads)
### Issue description
_gui_input is only called on the focused control for keyboard and joypad inputs and is not propagated to parent even if accept_event is NOT called.
Note that is does not affect mouse events (when the mouse_filter of the child is set to Pass).
### Steps to reproduce
- Launch the MRP, the button on screen will be automatically focused
- Press space, notice in the output that _gui_input is only called on the child.
- Notice that if you move the mouse on the button or even click on it, _gui_input is called on both the child and the parent.
### Minimal reproduction project (MRP)
[bug-gui-input-propagation.zip](https://github.com/user-attachments/files/17579412/bug-gui-input-propagation.zip)
Contributor guide
Research direction
Start by running the linked minimal reproduction project and tracing _gui_input handling for focused keyboard and joypad events versus mouse events. Confirm the expected propagation from the child Control to its parent, then add or update a regression test showing that parent callbacks occur when accept_event is not called.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100