keyboard: Use microseconds for notify_keyval()

ClutterVirtualInputDevice::notify_keyval() expects time to be in
microseconds but Clutter::get_current_event_time() returns the time in
milliseconds. On Wayland the generated event triggers all the warnings
in MetaDisplay::sanity_check_timestamps() due to the event time
seemingly being in the past.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1926>
This commit is contained in:
Sebastian Keller 2021-07-22 17:24:30 +02:00 committed by Marge Bot
parent 8edd6aef64
commit bb8daaeb2f

View File

@ -2125,12 +2125,12 @@ var KeyboardController = class {
}
keyvalPress(keyval) {
this._virtualDevice.notify_keyval(Clutter.get_current_event_time(),
this._virtualDevice.notify_keyval(Clutter.get_current_event_time() * 1000,
keyval, Clutter.KeyState.PRESSED);
}
keyvalRelease(keyval) {
this._virtualDevice.notify_keyval(Clutter.get_current_event_time(),
this._virtualDevice.notify_keyval(Clutter.get_current_event_time() * 1000,
keyval, Clutter.KeyState.RELEASED);
}
};