Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Unified Diff: ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc

Issue 889673004: ozone: evdev: Use kernel timestamps for mouse events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on MouseEvent timestamp changes & fix stime feedback Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
diff --git a/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc b/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
index 143f4ce34addab035ada221d613b204459e306f1..58b38a0a20fdbc8a406be17af0a000a6101d0bd6 100644
--- a/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
+++ b/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
@@ -274,9 +274,8 @@ void GestureInterpreterLibevdevCros::OnGestureMove(const Gesture* gesture,
cursor_->MoveCursor(gfx::Vector2dF(move->dx, move->dy));
// TODO(spang): Use move->ordinal_dx, move->ordinal_dy
- // TODO(spang): Use move->start_time, move->end_time
- dispatcher_->DispatchMouseMoveEvent(
- MouseMoveEventParams(id_, cursor_->GetLocation()));
+ dispatcher_->DispatchMouseMoveEvent(MouseMoveEventParams(
+ id_, cursor_->GetLocation(), StimeToTimedelta(gesture->end_time)));
}
void GestureInterpreterLibevdevCros::OnGestureScroll(
@@ -290,10 +289,10 @@ void GestureInterpreterLibevdevCros::OnGestureScroll(
if (!cursor_)
return; // No cursor!
- // TODO(spang): Use scroll->start_time
if (is_mouse_) {
dispatcher_->DispatchMouseWheelEvent(MouseWheelEventParams(
- id_, cursor_->GetLocation(), gfx::Vector2d(scroll->dx, scroll->dy)));
+ id_, cursor_->GetLocation(), gfx::Vector2d(scroll->dx, scroll->dy),
+ StimeToTimedelta(gesture->end_time)));
} else {
dispatcher_->DispatchScrollEvent(ScrollEventParams(
id_, ET_SCROLL, cursor_->GetLocation(),
@@ -313,19 +312,18 @@ void GestureInterpreterLibevdevCros::OnGestureButtonsChange(
if (!cursor_)
return; // No cursor!
- // TODO(spang): Use buttons->start_time, buttons->end_time
if (buttons->down & GESTURES_BUTTON_LEFT)
- DispatchMouseButton(BTN_LEFT, true);
+ DispatchMouseButton(BTN_LEFT, true, gesture->end_time);
if (buttons->down & GESTURES_BUTTON_MIDDLE)
- DispatchMouseButton(BTN_MIDDLE, true);
+ DispatchMouseButton(BTN_MIDDLE, true, gesture->end_time);
if (buttons->down & GESTURES_BUTTON_RIGHT)
- DispatchMouseButton(BTN_RIGHT, true);
+ DispatchMouseButton(BTN_RIGHT, true, gesture->end_time);
if (buttons->up & GESTURES_BUTTON_LEFT)
- DispatchMouseButton(BTN_LEFT, false);
+ DispatchMouseButton(BTN_LEFT, false, gesture->end_time);
if (buttons->up & GESTURES_BUTTON_MIDDLE)
- DispatchMouseButton(BTN_MIDDLE, false);
+ DispatchMouseButton(BTN_MIDDLE, false, gesture->end_time);
if (buttons->up & GESTURES_BUTTON_RIGHT)
- DispatchMouseButton(BTN_RIGHT, false);
+ DispatchMouseButton(BTN_RIGHT, false, gesture->end_time);
}
void GestureInterpreterLibevdevCros::OnGestureContactInitiated(
@@ -415,10 +413,12 @@ void GestureInterpreterLibevdevCros::OnGestureMetrics(
}
void GestureInterpreterLibevdevCros::DispatchMouseButton(unsigned int button,
- bool down) {
+ bool down,
+ stime_t time) {
bool allow_remap = is_mouse_;
- dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams(
- id_, cursor_->GetLocation(), button, down, allow_remap));
+ dispatcher_->DispatchMouseButtonEvent(
+ MouseButtonEventParams(id_, cursor_->GetLocation(), button, down,
+ allow_remap, StimeToTimedelta(time)));
}
void GestureInterpreterLibevdevCros::DispatchChangedKeys(Evdev* evdev,

Powered by Google App Engine
This is Rietveld 408576698