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

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 1153413004: Ensure grouped touch events have a common timestamp on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@input_coalesce_webtouch
Patch Set: Cleanup Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 3e262c1cdd0dc5472b5ad1e23b09041d74956ce2..76818369d93dce38782d3d3315b9300762886c74 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -2308,6 +2308,9 @@ LRESULT HWNDMessageHandler::OnTouchEvent(UINT message,
if (ui::GetTouchInputInfoWrapper(reinterpret_cast<HTOUCHINPUT>(l_param),
num_points, input.get(),
sizeof(TOUCHINPUT))) {
+ // input[i].dwTime doesn't necessarily relate to the system time at all,
+ // so use base::TimeTicks::Now().
+ const base::TimeTicks event_time = base::TimeTicks::Now();
int flags = ui::GetModifiersFromKeyState();
TouchEvents touch_events;
for (int i = 0; i < num_points; ++i) {
@@ -2348,20 +2351,16 @@ LRESULT HWNDMessageHandler::OnTouchEvent(UINT message,
touch_event_type = ui::ET_TOUCH_MOVED;
}
if (touch_event_type != ui::ET_UNKNOWN) {
- // input[i].dwTime doesn't necessarily relate to the system time at all,
- // so use base::TimeTicks::Now()
- const base::TimeTicks now = base::TimeTicks::Now();
ui::TouchEvent event(touch_event_type,
gfx::Point(point.x, point.y),
id_generator_.GetGeneratedID(input[i].dwID),
- now - base::TimeTicks());
+ event_time - base::TimeTicks());
event.set_flags(flags);
event.latency()->AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
0,
0,
- base::TimeTicks::FromInternalValue(
- event.time_stamp().ToInternalValue()),
+ event_time,
1);
touch_events.push_back(event);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698