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

physics_object_picking_first_only breaks mouse enter/exit/motion events #89641

Closed
mnemoli opened this issue Mar 18, 2024 · 0 comments · Fixed by #89643
Closed

physics_object_picking_first_only breaks mouse enter/exit/motion events #89641

mnemoli opened this issue Mar 18, 2024 · 0 comments · Fixed by #89643

Comments

@mnemoli
Copy link
Contributor

mnemoli commented Mar 18, 2024

Tested versions

  • Reproducible in 4.3-dev4
  • Introduced by a407219

System information

Godot v4.3.dev4 - Windows 10.0.19045

Issue description

This PR introduced physics_object_picking_first_only: #75688

See test project attached.

If you wiggle the mouse around over two logos with sort+first_only off you get this:
image

With both settings on you get this, and clicking also fires spurious enter/exit events:
image

I think the problem is here:

if (mm.is_valid() && mm->get_device() == InputEvent::DEVICE_ID_INTERNAL) {
send_event = false;
}

If send_event == false then the break at L860 is never called. Moving L859/860 out of the send_event check makes all the events work as expected.

Steps to reproduce

  • Wiggle mouse over 2 logos with both physics settings off. 2 mouse_entered and 2 mouse_shape_entered events will be logged (one per logo).
  • Click mouse over 2 logos with both settings off. 2 click events will be raised.
  • Wiggle mouse (with brief pauses in motion) over 2 icons with both physics settings on. enter/exit events will be continuously raised.
  • Click mouse over 2 logos with both settings on. 1 click event will be raised along with spurious enter/exit events.

Minimal reproduction project (MRP)

BugPickingZSort2.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants