Area2D not registering mouse events when inside a Window

Godot Version

4.6.1.stable, Linux X11

Question

Is an Area2D, when being a child of a Window, supposed to not register mouse_entered events or is this a bug or am I doing something wrong?

When starting this and hovering the mouse over the displayed godot-icon, no mouse entered outputs are printed.

Steps to reproduce

  1. Create a new project in Compatibility or Forward+ mode.
  2. Add a Node2D root node.
  3. Add a Window child to the Node2D.
  4. Add an Area2D child to the Window and attach a new script to it.
  5. (Optionally add a Sprite2D child to the Area2D and drag the res://icon.svg on it. Just to see where the area is.)
  6. Add a CollisionShape2D child to the Area2D.
  7. Set the CollisionShape2D’s shape to RectangleShape2D and resize it to your liking.
  8. Connect the Area2D’s mouse_entered() signal to the Area2D’s script. (Not sure if that’s supposed to be required. Overwriting CollisionObject2D’s_mouse_enter() yields the same result for me.)
  9. Print something inside it, to see whether the event got executed.

Object Picking is enabled (by default, I think), if that matters. I did not change any settings, as far as I’m aware.

Thanks in advance!

Feel free to ask for more specific information or any clarifications.

(post deleted by author)

Try turning the Window’s mouse_passthrough flag On.

Thanks for the suggestion, unfortunately that does not help.

The way I understood it, Mouse Passthrough should do the opposite, no? I.e. pass the mouse events to the stuff that is under the Window. Well maybe it does not prohibit the window from getting the events too, not sure.

Perhaps it’s helpful to know that implementing_unhandled_input() in the Area2D node DOES register mouse movements, and that even if the mouse is not hovering the Window. So, the engine might handle Area2D collision events separately from those input events, even if it’s about mouse collision.

Try using a StaticBody2D see if that works better.