Commit e21369e1 authored by Jose Dapena Paz's avatar Jose Dapena Paz Committed by Commit Bot

[ozone/wayland] Fix wayland keyboard event timestamps

On using keyboard with Wayland, we get performance timing asserts. It is
caused by inconsistency in how we generate the timestamps from the
native events. This replicates the reasoning of Windows
EventTimeFromMSG, as the problem is the same. For platform
independent events we use TimeTicks::Now, but for native events
we use a different time origin.

So let's use for keyboard also EventTimeForNow().

Bug: 891205
Change-Id: Iaf1c2e106ea39c7ea3fc6da5c5ab647109f87c7a
Reviewed-on: https://chromium-review.googlesource.com/1256569Reviewed-by: default avatarMaksim Sisov <msisov@igalia.com>
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
Cr-Commit-Position: refs/heads/master@{#595790}
parent fefb98a9
......@@ -8,6 +8,7 @@
#include "base/files/scoped_file.h"
#include "ui/base/ui_features.h"
#include "ui/events/base_event_utils.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
......@@ -120,9 +121,8 @@ void WaylandKeyboard::Key(void* data,
key, down, false /*suppress_auto_repeat*/, device_id);
// TODO(tonikitoo,msisov): Handler 'repeat' parameter below.
keyboard->DispatchKey(
key, down, false /*repeat*/,
base::TimeTicks() + base::TimeDelta::FromMilliseconds(time), device_id);
keyboard->DispatchKey(key, down, false /*repeat*/, EventTimeForNow(),
device_id);
}
void WaylandKeyboard::Modifiers(void* data,
......
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