[gnome-shell/gnome-40] keyboard: Use microseconds for notify_keyval()



commit cff0d42651d1bdb6bf97ea97135a5c6298ef76b1
Author: Sebastian Keller <skeller gnome org>
Date:   Thu Jul 22 17:24:30 2021 +0200

    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>
    (cherry picked from commit bb8daaeb2f1f1e0d11c0221e665dca2e892da22d)

 js/ui/keyboard.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index bc72d77f3d..d0dde5b23a 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -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);
     }
 };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]