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

Viewport.set_input_as_handled() causes spurious _mouse_enter(), _mouse_exit() events #68637

Closed
paulmiller opened this issue Nov 14, 2022 · 3 comments
Labels

Comments

@paulmiller
Copy link

Godot version

3.5.1.stable, 4.0.beta

System information

Arch Linux

Issue description

The attached Godot 3 project has a clickable sphere Area with _input_event() overridden to call get_viewport().set_input_as_handled(). Clicking on the Area causes _input_event() to be called, followed immediately by calls to _mouse_exit() and then _mouse_enter(), even though the mouse never left the Area.

If you replace get_viewport().set_input_as_handled() with get_tree().set_input_as_handled(), then _mouse_exit() and _mouse_enter() are not called.

Godot 4 doesn't have get_tree().set_input_as_handled(); it was removed in 8e6960a. get_viewport().set_input_as_handled() has the same bug in Godot 4.

Steps to reproduce

run attached project, click the sphere, see spurious mouse exit/enter logged in the console

Minimal reproduction project

click-handler.zip

@paulmiller
Copy link
Author

(I originally posed this in the form of a question on r/godot, but on further thought I suspect it's actually a bug.)

@Sauermann
Copy link
Contributor

duplicate of #61924
will get fixed by #68019

@paulmiller
Copy link
Author

Verified fix when cherry picked to beta 4. Thanks!

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

3 participants