Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Margin Containers consume mouse input even when filter set to PASS #75372

Closed
CosmoD3v opened this issue Mar 26, 2023 · 1 comment
Closed

Margin Containers consume mouse input even when filter set to PASS #75372

CosmoD3v opened this issue Mar 26, 2023 · 1 comment
Labels

Comments

@CosmoD3v
Copy link

Godot version

4.0.stable

System information

Windows 10

Issue description

While working on a project, I was having issues using the mouse_entered signal.
One of my nodes was consuming the mouse event, after some digging I found the culprit; MarginContainer.

I decided to create a new test scene to re-create the bug and to my surprise, the bug still occured.
MarginContainer nodes will always consume mouse input events when set to mouse filter PASS if a margin container exists in the scene tree lower than the node that you are attempting to receive them in.

I waved my mouse over the area of the nodes and the console didn't log anything from my script.
Once I changed the MarginContainer's mouse filter to ignore, it finally got it to print the event in my other node.

Temporarily, you can opt to have that container always ignore mouse events so that they can be caught elsewhere.
But for now, you'll just have to deal with margin containers always consuming these events if set to Pass.

Steps to reproduce

image
image
image
image

Minimal reproduction project

Reproduction Project.zip

@KoBeWi
Copy link
Member

KoBeWi commented Mar 27, 2023

From PASS description:

If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it.

The event is passed to parent nodes not siblings. You need to use IGNORE.

See also godotengine/godot-proposals#3613 and the other linked issues in there.

@KoBeWi KoBeWi closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants