godotengine / godot

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

Sub-window does not capture mouse_entered() / mouse_exited() events on Area2D #98789

Open JHaller27 opened 3 weeks ago

JHaller27 commented 3 weeks ago

Tested versions

System information

Godot v4.3.stable (77dcf97d8) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 32.0.15.6094) - AMD Ryzen 5 5600X 6-Core Processor (12 Threads)

Issue description

With Area2D nodes correctly configured in both the main window and sub-window...

Expected Area2D's mouse_entered & mouse_exited signals should fire when the mouse enters/exits the collision shape in both the main window and sub-window.

Actual The mouse_entered & mouse_exited signals do not fire in the sub-window.

Steps to reproduce

Minimal reproduction project (MRP)

SubWindowMouseBug.zip

komugi1211s commented 3 weeks ago

Checking the Viewport -> Physics -> Object Picking property in sub-window will make the viewport pick the object inside the window.

Subwindow property

after checking

JHaller27 commented 3 weeks ago

Can confirm this works. Thanks, @komugi1211s! I'm not sure why the ability to pass through mouse events defaults to false... Could that be changed?

Sauermann commented 1 week ago

Object picking can be an expensive operation and should be enabled only if needed. So currently I believe, that a change of the defaults is very unlikely to happen.