Skip to content

Commit c03a7b7

Browse files
committed
Delay Mouse signals until after internal processing
1 parent 987832b commit c03a7b7

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

scene/gui/control.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3900,14 +3900,6 @@ void Control::_notification(int p_notification) {
39003900
RenderingServer::get_singleton()->canvas_item_set_clip(get_canvas_item(), data.clip_contents);
39013901
} break;
39023902

3903-
case NOTIFICATION_MOUSE_ENTER: {
3904-
emit_signal(SceneStringName(mouse_entered));
3905-
} break;
3906-
3907-
case NOTIFICATION_MOUSE_EXIT: {
3908-
emit_signal(SceneStringName(mouse_exited));
3909-
} break;
3910-
39113903
case NOTIFICATION_FOCUS_ENTER: {
39123904
emit_signal(SceneStringName(focus_entered));
39133905
queue_redraw();

scene/main/viewport.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2610,6 +2610,7 @@ void Viewport::_gui_update_mouse_over() {
26102610
// Send Mouse Exit notifications.
26112611
for (int exit_control_index : needs_exit) {
26122612
gui.mouse_over_hierarchy[exit_control_index]->notification(Control::NOTIFICATION_MOUSE_EXIT);
2613+
gui.mouse_over_hierarchy[exit_control_index]->emit_signal(SceneStringName(mouse_exited));
26132614
}
26142615

26152616
// Update the mouse over hierarchy.
@@ -2621,6 +2622,7 @@ void Viewport::_gui_update_mouse_over() {
26212622
// Send Mouse Enter notifications.
26222623
for (int i = needs_enter.size() - 1; i >= 0; i--) {
26232624
needs_enter[i]->notification(Control::NOTIFICATION_MOUSE_ENTER);
2625+
needs_enter[i]->emit_signal(SceneStringName(mouse_entered));
26242626
}
26252627

26262628
gui.sending_mouse_enter_exit_notifications = false;
@@ -3274,6 +3276,7 @@ void Viewport::_update_mouse_over(Vector2 p_pos) {
32743276
for (int i = over_ancestors.size() - 1; i >= 0; i--) {
32753277
gui.mouse_over_hierarchy.push_back(over_ancestors[i]);
32763278
over_ancestors[i]->notification(Control::NOTIFICATION_MOUSE_ENTER);
3279+
over_ancestors[i]->emit_signal(SceneStringName(mouse_entered));
32773280
}
32783281

32793282
// Send Mouse Enter Self notification.
@@ -3365,6 +3368,7 @@ void Viewport::_drop_mouse_over(Control *p_until_control) {
33653368
for (int i = gui.mouse_over_hierarchy.size() - 1; i >= notification_until; i--) {
33663369
if (gui.mouse_over_hierarchy[i]->is_inside_tree()) {
33673370
gui.mouse_over_hierarchy[i]->notification(Control::NOTIFICATION_MOUSE_EXIT);
3371+
gui.mouse_over_hierarchy[i]->emit_signal(SceneStringName(mouse_exited));
33683372
}
33693373
}
33703374
gui.mouse_over_hierarchy.resize(notification_until);

0 commit comments

Comments
 (0)