]> git.eshelyaron.com Git - emacs.git/commitdiff
Translate timestamps when using GTK native input
authorPo Lu <luangruo@yahoo.com>
Mon, 17 Jan 2022 01:48:01 +0000 (09:48 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 17 Jan 2022 01:48:01 +0000 (09:48 +0800)
* src/gtkutil.c (xg_widget_key_press_event_cb): Use timestamp
specified in key event.
(xg_filter_key): Translate timestamps.

src/gtkutil.c

index 48e981d0d9afdc1778c446f4c38172e27f253933..3cb8cd1533298619d1630461b056eef308857eb6 100644 (file)
@@ -6151,6 +6151,7 @@ xg_widget_key_press_event_cb (GtkWidget *widget, GdkEvent *event,
 
   inev.ie.modifiers
     |= x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO (f), xstate);
+  inev.ie.timestamp = event->key.time;
 
   if (event->key.is_modifier)
     goto done;
@@ -6324,6 +6325,7 @@ xg_filter_key (struct frame *frame, XEvent *xkey)
                                           NULL, NULL, &consumed);
       xg_add_virtual_mods (dpyinfo, &xg_event->key);
       xg_event->key.state &= ~consumed;
+      xg_event->key.time = xkey->xkey.time;
 #if GTK_CHECK_VERSION (3, 6, 0)
       xg_event->key.is_modifier = gdk_x11_keymap_key_is_modifier (keymap,
                                                                  xg_event->key.hardware_keycode);
@@ -6337,6 +6339,7 @@ xg_filter_key (struct frame *frame, XEvent *xkey)
       xg_event->key.hardware_keycode = xev->detail;
       xg_event->key.group = xev->group.effective;
       xg_event->key.state = xev->mods.effective;
+      xg_event->key.time = xev->time;
       gdk_keymap_translate_keyboard_state (keymap,
                                           xev->detail,
                                           xev->mods.effective,