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

Send Mouse Enter/Exit Notifications independently of mouse focus #59555

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

Sauermann
Copy link
Contributor

@Sauermann Sauermann commented Mar 26, 2022

Previously, the mouse focus (Viewport::gui.mouse_focus) influenced, when NOTIFICATION_MOUSE_ENTER and NOTIFICATION_MOUSE_EXIT are sent.
This patch changes the behavior, so that only the mouse position, but not the mouse focus has an effect on when the two notifications are sent.

resolve #19808
related to #20881
related to #32943
related to #54565

@RandomShaper
Copy link
Member

At line 1611 (and maybe at some other spots) there's logic similar to the one modified in this PR, this time for the case of mouse exit. Wouldn't it need some changes, too?

@Sauermann
Copy link
Contributor Author

@RandomShaper Thank you for pointing me to this code section.

The code around line 1611 is responsible for sending EXIT notifications after a DragAndDrop LBM-release. Since EXIT notifications are now handled solely by mouse position, that code at line 1611 can be safely removed, since it is redundant (it would trigger only after the node already has lost focus).

I searched and found no other locations with similar logic.

@Sauermann
Copy link
Contributor Author

It would be good, if someone with knowledge about mouse capture mode can have a look at this.

@RandomShaper
Copy link
Member

It would be good, if someone with knowledge about mouse capture mode can have a look at this.

Any specific concern regarding capture?

@Sauermann
Copy link
Contributor Author

I was concerned, that MOUSE_MODE_CAPTURED might interfere with this change in unexpected ways based on this comment: #20881 (comment)

I made a few tests and since in that mode the mouse cursor is always kept in the same place, it behaves as I would expect regarding Enter/Exit Notifications.

Copy link
Member

@RandomShaper RandomShaper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, this is good to to. Let's have it in the back of our minds in case something weird with mouse enter/exit happens, though.

@akien-mga akien-mga merged commit 2e85105 into godotengine:master Mar 28, 2022
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

mouse_exited event/notification called after mouse button released in Control
4 participants