event_filter: touch/press untouch/release sequence

This commit changes the touch-click filter to adhere the following
sequence:

  touch         (physical)
  press         (artifically generated)
  release       (artificially generated)
  release_touch (physical)

This order is important because nitpicker's focus handling takes
press/release events into account. If the release-touch event appears
before the release event, nitpicker subsumes the release-touch event
to the sequence that started with the press event, instead of handling
it as a free-standing event.

Issue #4332
This commit is contained in:
Norman Feske 2022-02-18 16:53:31 +01:00 committed by Christian Helmuth
parent 55492fbe5b
commit ca9460aead

View File

@ -46,7 +46,8 @@ class Event_filter::Touch_click_source : public Source, Source::Filter
Input::Event ev = event;
/* forward original event */
destination.submit(ev);
if (!ev.touch_release())
destination.submit(ev);
/* supplement mouse click and absolute motion */
ev.handle_touch([&] (Input::Touch_id id, float x, float y) {
@ -74,6 +75,10 @@ class Event_filter::Touch_click_source : public Source, Source::Filter
_pressed = false;
}
});
/* forward original event */
if (ev.touch_release())
destination.submit(ev);
}
public: