From 262d84fa9050a909359b04ac4a58ebc75d002dd5 Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Thu, 19 Jan 2023 14:56:32 +0100 Subject: [PATCH] Fix MOUSE_FILTER_STOP not affecting emulated mouse events Touch and Drag events are now stopped by MOUSE_FILTER_STOP --- scene/main/viewport.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 7091dd0388e..b06ede1be88 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1348,7 +1348,7 @@ bool Viewport::_gui_call_input(Control *p_control, const Ref &p_inpu Ref ev = p_input; // Returns true if an event should be impacted by a control's mouse filter. - bool is_mouse_event = Ref(p_input).is_valid(); + bool is_pointer_event = Ref(p_input).is_valid() || Ref(p_input).is_valid() || Ref(p_input).is_valid(); Ref mb = p_input; bool is_scroll_event = mb.is_valid() && @@ -1372,8 +1372,8 @@ bool Viewport::_gui_call_input(Control *p_control, const Ref &p_inpu stopped = true; break; } - if (control->data.mouse_filter == Control::MOUSE_FILTER_STOP && is_mouse_event && !(is_scroll_event && control->data.force_pass_scroll_events)) { - // Mouse events are stopped by default with MOUSE_FILTER_STOP, unless we have a scroll event and force_pass_scroll_events set to true + if (control->data.mouse_filter == Control::MOUSE_FILTER_STOP && is_pointer_event && !(is_scroll_event && control->data.force_pass_scroll_events)) { + // Mouse, ScreenDrag and ScreenTouch events are stopped by default with MOUSE_FILTER_STOP, unless we have a scroll event and force_pass_scroll_events set to true stopped = true; break; }