On my ubuntu 20.04, wayland+weston+ivi-homescreen running the default flutter create "increment" button app with debug engine v2.10.3 arm64, I'm finding that the app often crashes when using mouse input because this assertion check fails.
Which calls getPointerPhase(), and in some instances the state can be such that p->buttons is not null and state == WL_POINTER_BUTTON_STATE_RELEASED which ends up translating the event to FlutterPointerPhase::kUp.
https://github.com/toyota-connected/ivi-homescreen/blob/main/shell/display.cc#L337
However, if no kDown event is sent between this kUp event and some previous kUp event (say from releasing the mouse button) then the debug assert fails and the app crashes with the FATAL warning above.
I propose that the wayland input event listener Display::pointer_handle_motion() should only translate to FlutterPointerPhase::kMove or FlutterPointerPhase::kHover depending on whether the left mouse button is currently pressed down or not during the motion event. PR that implements this change coming shortly.
On my ubuntu 20.04, wayland+weston+ivi-homescreen running the default flutter create "increment" button app with debug engine v2.10.3 arm64, I'm finding that the app often crashes when using mouse input because this assertion check fails.
https://github.com/flutter/engine/blob/main/lib/ui/window/pointer_data_packet_converter.cc#L190
I believe this is a manifestation of a bug in translating wayland input events to flutter, specifically within Display::pointer_handle_motion() https://github.com/toyota-connected/ivi-homescreen/blob/main/shell/display.cc#L399
Which calls getPointerPhase(), and in some instances the state can be such that p->buttons is not null and state == WL_POINTER_BUTTON_STATE_RELEASED which ends up translating the event to FlutterPointerPhase::kUp. https://github.com/toyota-connected/ivi-homescreen/blob/main/shell/display.cc#L337 However, if no kDown event is sent between this kUp event and some previous kUp event (say from releasing the mouse button) then the debug assert fails and the app crashes with the FATAL warning above.
Based on what I've gathered from reading the comments in embedder.h https://github.com/flutter/engine/blob/main/shell/platform/embedder/embedder.h#L727-L743
I propose that the wayland input event listener Display::pointer_handle_motion() should only translate to FlutterPointerPhase::kMove or FlutterPointerPhase::kHover depending on whether the left mouse button is currently pressed down or not during the motion event. PR that implements this change coming shortly.