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

Introduce Viewport functions for keeping the mouse over state consistent #99890

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sauermann
Copy link
Contributor

@Sauermann Sauermann commented Dec 1, 2024

Some users had problems with forwarding input events to SubViewport since #88992, which adjusted a default value and in effect prevented calling gui_input when used without changes.
I still believe, that this change makes mouse-handling more consistent. But this change makes it necessary to give users tools and instructions about how to deal with this new situation.
Previously I did believe, that sending NOTIFICATION_VP_MOUSE_ENTER and NOTIFICATION_VP_MOUSE_EXIT was sufficient (see godotengine/godot-demo-projects#1139), but the MRP of #98003 demonstrates, that this approach still leaves some situations unresolved.

So I want to introduce with this PR two functions, that allow users to notify viewports about the mouse-over state. These two functions take care of all internal state-adjustments.

I discarded #90444 as a solution, because while it automatically handles the mouse-enter-part, users still have no solution for the mouse-exit-part.
I discarded #89868 as a solution, because it is restricted to TextureRect and doesn't provide a generic solution for all potential relevant nodes.

The introduction of these two function with their descriptions could be seen as either a partial or a total fix of issue #97267.

doc/classes/Viewport.xml Outdated Show resolved Hide resolved
doc/classes/Viewport.xml Outdated Show resolved Hide resolved
scene/main/viewport.cpp Outdated Show resolved Hide resolved
scene/main/viewport.cpp Outdated Show resolved Hide resolved
@Sauermann Sauermann force-pushed the fix-vp-mouse-notifications branch from 6537252 to 8ce663f Compare December 1, 2024 10:08
@Sauermann Sauermann force-pushed the fix-vp-mouse-notifications branch from 8ce663f to 8e00035 Compare December 1, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants