Commit f40d2a53 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

[ozone/wayland] Use ui::EventTimeForNow for pointer events

Fixes crash when focusing textfield with pointer click

Bug: 878692

Change-Id: Ifb66115e42bdd06c572f784dff673309a2562598
Reviewed-on: https://chromium-review.googlesource.com/1193870Reviewed-by: default avatarMaksim Sisov <msisov@igalia.com>
Commit-Queue: Jani Hautakangas <jani.hautakangas@lge.com>
Cr-Commit-Position: refs/heads/master@{#595803}
parent e3a5d8f5
......@@ -94,8 +94,8 @@ void WaylandPointer::Motion(void* data,
pointer->location_.SetPoint(wl_fixed_to_double(surface_x),
wl_fixed_to_double(surface_y));
MouseEvent event(ET_MOUSE_MOVED, gfx::Point(), gfx::Point(),
base::TimeTicks() + base::TimeDelta::FromMilliseconds(time),
pointer->GetFlagsWithKeyboardModifiers(), 0);
EventTimeForNow(), pointer->GetFlagsWithKeyboardModifiers(),
0);
event.set_location_f(pointer->location_);
event.set_root_location_f(pointer->location_);
pointer->callback_.Run(&event);
......@@ -146,10 +146,8 @@ void WaylandPointer::Button(void* data,
// MouseEvent's flags should contain the button that was released too.
const int flags = pointer->GetFlagsWithKeyboardModifiers() | changed_button;
MouseEvent event(type, gfx::Point(), gfx::Point(),
base::TimeTicks() + base::TimeDelta::FromMilliseconds(time),
flags, changed_button);
MouseEvent event(type, gfx::Point(), gfx::Point(), EventTimeForNow(), flags,
changed_button);
event.set_location_f(pointer->location_);
event.set_root_location_f(pointer->location_);
......@@ -187,10 +185,8 @@ void WaylandPointer::Axis(void* data,
MouseWheelEvent::kWheelDelta);
else
return;
MouseWheelEvent event(
offset, gfx::Point(), gfx::Point(),
base::TimeTicks() + base::TimeDelta::FromMilliseconds(time),
pointer->GetFlagsWithKeyboardModifiers(), 0);
MouseWheelEvent event(offset, gfx::Point(), gfx::Point(), EventTimeForNow(),
pointer->GetFlagsWithKeyboardModifiers(), 0);
event.set_location_f(pointer->location_);
event.set_root_location_f(pointer->location_);
pointer->callback_.Run(&event);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment