Merge pull request #71677 from Sauermann/fix-emulate-touch-passthrough
Fix MOUSE_FILTER_STOP not affecting emulated mouse events
This commit is contained in:
commit
bea2dea15d
1 changed files with 3 additions and 3 deletions
|
@ -1348,7 +1348,7 @@ bool Viewport::_gui_call_input(Control *p_control, const Ref<InputEvent> &p_inpu
|
||||||
Ref<InputEvent> ev = p_input;
|
Ref<InputEvent> ev = p_input;
|
||||||
|
|
||||||
// Returns true if an event should be impacted by a control's mouse filter.
|
// Returns true if an event should be impacted by a control's mouse filter.
|
||||||
bool is_mouse_event = Ref<InputEventMouse>(p_input).is_valid();
|
bool is_pointer_event = Ref<InputEventMouse>(p_input).is_valid() || Ref<InputEventScreenDrag>(p_input).is_valid() || Ref<InputEventScreenTouch>(p_input).is_valid();
|
||||||
|
|
||||||
Ref<InputEventMouseButton> mb = p_input;
|
Ref<InputEventMouseButton> mb = p_input;
|
||||||
bool is_scroll_event = mb.is_valid() &&
|
bool is_scroll_event = mb.is_valid() &&
|
||||||
|
@ -1372,8 +1372,8 @@ bool Viewport::_gui_call_input(Control *p_control, const Ref<InputEvent> &p_inpu
|
||||||
stopped = true;
|
stopped = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (control->data.mouse_filter == Control::MOUSE_FILTER_STOP && is_mouse_event && !(is_scroll_event && control->data.force_pass_scroll_events)) {
|
if (control->data.mouse_filter == Control::MOUSE_FILTER_STOP && is_pointer_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
|
// 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;
|
stopped = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue