| Index: components/exo/pointer.cc
|
| diff --git a/components/exo/pointer.cc b/components/exo/pointer.cc
|
| index ef06cb94e5b726a900703cbad0f43b1ba08c5462..1cc32a426376b4baeb219c431323cf15b476a977 100644
|
| --- a/components/exo/pointer.cc
|
| +++ b/components/exo/pointer.cc
|
| @@ -206,13 +206,26 @@ void Pointer::OnMouseEvent(ui::MouseEvent* event) {
|
| break;
|
| }
|
| case ui::ET_SCROLL_FLING_START: {
|
| + // Fling start in chrome signals the lifting of fingers after scrolling.
|
| + // In wayland terms this signals the end of a scroll sequence.
|
| delegate_->OnPointerScrollStop(event->time_stamp());
|
| delegate_->OnPointerFrame();
|
| break;
|
| }
|
| case ui::ET_SCROLL_FLING_CANCEL: {
|
| - delegate_->OnPointerScrollCancel(event->time_stamp());
|
| - delegate_->OnPointerFrame();
|
| + // Fling cancel is generated very generously at every touch of the
|
| + // touchpad. Since it's not directly supported by the delegate, we do not
|
| + // want limit this event to only right after a fling start has been
|
| + // generated to prevent erronous behavior.
|
| + if (last_event_type_ == ui::ET_SCROLL_FLING_START) {
|
| + // We emulate fling cancel by starting a new scroll sequence that
|
| + // scrolls by 0 pixels, effectively stopping any kinetic scroll motion.
|
| + delegate_->OnPointerScroll(event->time_stamp(), gfx::Vector2dF(),
|
| + false);
|
| + delegate_->OnPointerFrame();
|
| + delegate_->OnPointerScrollStop(event->time_stamp());
|
| + delegate_->OnPointerFrame();
|
| + }
|
| break;
|
| }
|
| case ui::ET_MOUSE_MOVED:
|
| @@ -226,6 +239,7 @@ void Pointer::OnMouseEvent(ui::MouseEvent* event) {
|
| break;
|
| }
|
|
|
| + last_event_type_ = event->type();
|
| UpdateCursorScale();
|
| }
|
|
|
|
|