summaryrefslogtreecommitdiffstats
path: root/scene/gui/control.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-11-09 18:08:37 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-11-09 18:08:37 +0100
commitd36cc7313e3c0c8d717522964cc8c577b8a0863a (patch)
tree159821f1467c172f77608396b39a23c12412f2f1 /scene/gui/control.cpp
parent25e650ab61f4fe65da2c041b42db6cfe3121df85 (diff)
parentd24d73ba3140b540a017bb230e57d9cde0c3d806 (diff)
downloadredot-engine-d36cc7313e3c0c8d717522964cc8c577b8a0863a.tar.gz
Merge pull request #84547 from kitbdev/mouse-notif-3
Make Mouse Enter/Exit notifications match Mouse Events
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r--scene/gui/control.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index c7ff5980cb..87539ef8f2 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -1831,9 +1831,18 @@ bool Control::has_point(const Point2 &p_point) const {
void Control::set_mouse_filter(MouseFilter p_filter) {
ERR_MAIN_THREAD_GUARD;
ERR_FAIL_INDEX(p_filter, 3);
+
+ if (data.mouse_filter == p_filter) {
+ return;
+ }
+
data.mouse_filter = p_filter;
notify_property_list_changed();
update_configuration_warnings();
+
+ if (get_viewport()) {
+ get_viewport()->_gui_update_mouse_over();
+ }
}
Control::MouseFilter Control::get_mouse_filter() const {
@@ -3568,6 +3577,8 @@ void Control::_bind_methods() {
BIND_CONSTANT(NOTIFICATION_RESIZED);
BIND_CONSTANT(NOTIFICATION_MOUSE_ENTER);
BIND_CONSTANT(NOTIFICATION_MOUSE_EXIT);
+ BIND_CONSTANT(NOTIFICATION_MOUSE_ENTER_SELF);
+ BIND_CONSTANT(NOTIFICATION_MOUSE_EXIT_SELF);
BIND_CONSTANT(NOTIFICATION_FOCUS_ENTER);
BIND_CONSTANT(NOTIFICATION_FOCUS_EXIT);
BIND_CONSTANT(NOTIFICATION_THEME_CHANGED);