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, ...@@ -94,8 +94,8 @@ void WaylandPointer::Motion(void* data,
pointer->location_.SetPoint(wl_fixed_to_double(surface_x), pointer->location_.SetPoint(wl_fixed_to_double(surface_x),
wl_fixed_to_double(surface_y)); wl_fixed_to_double(surface_y));
MouseEvent event(ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), MouseEvent event(ET_MOUSE_MOVED, gfx::Point(), gfx::Point(),
base::TimeTicks() + base::TimeDelta::FromMilliseconds(time), EventTimeForNow(), pointer->GetFlagsWithKeyboardModifiers(),
pointer->GetFlagsWithKeyboardModifiers(), 0); 0);
event.set_location_f(pointer->location_); event.set_location_f(pointer->location_);
event.set_root_location_f(pointer->location_); event.set_root_location_f(pointer->location_);
pointer->callback_.Run(&event); pointer->callback_.Run(&event);
...@@ -146,10 +146,8 @@ void WaylandPointer::Button(void* data, ...@@ -146,10 +146,8 @@ void WaylandPointer::Button(void* data,
// MouseEvent's flags should contain the button that was released too. // MouseEvent's flags should contain the button that was released too.
const int flags = pointer->GetFlagsWithKeyboardModifiers() | changed_button; const int flags = pointer->GetFlagsWithKeyboardModifiers() | changed_button;
MouseEvent event(type, gfx::Point(), gfx::Point(), MouseEvent event(type, gfx::Point(), gfx::Point(), EventTimeForNow(), flags,
base::TimeTicks() + base::TimeDelta::FromMilliseconds(time), changed_button);
flags, changed_button);
event.set_location_f(pointer->location_); event.set_location_f(pointer->location_);
event.set_root_location_f(pointer->location_); event.set_root_location_f(pointer->location_);
...@@ -187,9 +185,7 @@ void WaylandPointer::Axis(void* data, ...@@ -187,9 +185,7 @@ void WaylandPointer::Axis(void* data,
MouseWheelEvent::kWheelDelta); MouseWheelEvent::kWheelDelta);
else else
return; return;
MouseWheelEvent event( MouseWheelEvent event(offset, gfx::Point(), gfx::Point(), EventTimeForNow(),
offset, gfx::Point(), gfx::Point(),
base::TimeTicks() + base::TimeDelta::FromMilliseconds(time),
pointer->GetFlagsWithKeyboardModifiers(), 0); pointer->GetFlagsWithKeyboardModifiers(), 0);
event.set_location_f(pointer->location_); event.set_location_f(pointer->location_);
event.set_root_location_f(pointer->location_); event.set_root_location_f(pointer->location_);
......
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