Skip to content

Commit 51d418a

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

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-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: 2 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;

0 commit comments

Comments
 (0)