guint keysym = event->key.keyval;
unsigned int xstate;
gunichar uc;
+#ifdef HAVE_XINPUT2
+ Time pending_keystroke_time;
+ struct xi_device_t *source;
+#endif
FOR_EACH_FRAME (tail, tem)
{
if (!f)
return true;
+#ifdef HAVE_XINPUT2
+ pending_keystroke_time
+ = FRAME_DISPLAY_INFO (f)->pending_keystroke_time;
+
+ if (event->key.time >= pending_keystroke_time)
+ FRAME_DISPLAY_INFO (f)->pending_keystroke_time = 0;
+#endif
+
if (!x_gtk_use_native_input
&& !FRAME_DISPLAY_INFO (f)->prefer_native_input)
return true;
|= x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO (f), xstate);
inev.ie.timestamp = event->key.time;
+#ifdef HAVE_XINPUT2
+ if (event->key.time == pending_keystroke_time)
+ {
+ source = xi_device_from_id (FRAME_DISPLAY_INFO (f),
+ FRAME_DISPLAY_INFO (f)->pending_keystroke_source);
+
+ if (source)
+ inev.ie.device = source->name;
+ }
+#endif
+
if (event->key.is_modifier)
goto done;
|| (x_gtk_use_native_input
&& x_filter_event (dpyinfo, event)))
{
+ /* Try to attribute core key events from the input
+ method to the input extension event that caused
+ them. */
+ dpyinfo->pending_keystroke_time = xev->time;
+ dpyinfo->pending_keystroke_source = xev->sourceid;
+
*finish = X_EVENT_DROP;
goto XI_OTHER;
}
|| dpyinfo->prefer_native_input)
&& xg_filter_key (any, event))
{
+ /* Try to attribute core key events from the input
+ method to the input extension event that caused
+ them. */
+ dpyinfo->pending_keystroke_time = xev->time;
+ dpyinfo->pending_keystroke_source = xev->sourceid;
+
*finish = X_EVENT_DROP;
goto XI_OTHER;
}