You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Godot v4.2.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3090 Ti (NVIDIA; 31.0.15.4629) - Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 Threads)
Issue description
There seems to be an issue with the TabContainer specifically:
all mouse clic input events are duplicated when calling _gui_input, and are sent twice as two separate events:
one with local coordinates of the control in the _gui_input method, as expected
the other one with global coordinates, caught afterwards by another node in its _input() method
This happens even with the mouse filter set to stop, and even when using accept_event() explicitly (which should not be required anyway if I understand correctly).
Steps to reproduce
Setup a project with a "select" input action bound to left mouse button
Have a Sprite Node with the following script:
func _input(event: InputEvent):
if event.is_action_pressed("select"):
print(event)
Have a canvas layer node, with a child tab container, and a TextureRect control
Have the following script attached to the TextureRect control
extends TextureRect
func _gui_input(event: InputEvent):
if event.is_action_pressed("select"):
print(event)
This gives the following layout:
Set the node mouse filter to STOP
Click on the Background node: the function _input is called with an input event as expected
Click on the texture rect: the function _gui_input is called, as expected, but the the function _input is also called from the Sprite Node with a different input event matching the first one except the coordinates are translated.
The behavior is the same with _unhandled_input() and event with explicity acquitance of the input event with accept_event() (which is logical if these are two separate events).
Expected behavior:
Only one event is sent in the child of the TabContainer's _gui_input method, with no duplicates.
This "proper" behavior is seen in all other tested container nodes, only the TabContainer seems at fault.
spoutnickgp
changed the title
Duplicate input events on TabContainer _gui_input()
Duplicate input events on TabContainer _gui_input() and _input()
May 15, 2024
Tested versions
System information
Godot v4.2.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3090 Ti (NVIDIA; 31.0.15.4629) - Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 Threads)
Issue description
There seems to be an issue with the TabContainer specifically:
all mouse clic input events are duplicated when calling
_gui_input
, and are sent twice as two separate events:_input()
methodThis happens even with the mouse filter set to stop, and even when using
accept_event()
explicitly (which should not be required anyway if I understand correctly).Steps to reproduce
This gives the following layout:
_input
is called with an input event as expected_gui_input
is called, as expected, but the the function _input is also called from the Sprite Node with a different input event matching the first one except the coordinates are translated.The behavior is the same with _unhandled_input() and event with explicity acquitance of the input event with accept_event() (which is logical if these are two separate events).
Expected behavior:
_gui_input
method, with no duplicates.Minimal reproduction project (MRP)
godot-tab-input-bug.zip
The text was updated successfully, but these errors were encountered: