XISelectEvents (FRAME_X_DISPLAY (f),
FRAME_X_WINDOW (f),
&mask, 1);
+
+#if defined USE_GTK && !defined HAVE_GTK3
+ memset (m, 0, l);
+ XISetMask (m, XI_RawKeyPress);
+
+ XISelectEvents (FRAME_X_DISPLAY (f),
+ FRAME_DISPLAY_INFO (f)->root_window,
+ &mask, 1);
+#endif
unblock_input ();
}
#endif
pending_keystroke_time = dpyinfo->pending_keystroke_time;
if (event->xkey.time >= pending_keystroke_time)
- dpyinfo->pending_keystroke_time = 0;
+ {
+#if defined USE_GTK && !defined HAVE_GTK3
+ if (!dpyinfo->pending_keystroke_time_special_p)
+#endif
+ dpyinfo->pending_keystroke_time = 0;
+#if defined USE_GTK && !defined HAVE_GTK3
+ else
+ dpyinfo->pending_keystroke_time_special_p = false;
+#endif
+ }
#endif
#ifdef USE_GTK
goto XI_OTHER;
}
+#if defined USE_GTK && !defined HAVE_GTK3
+ case XI_RawKeyPress:
+ {
+ XIRawEvent *raw_event = (XIRawEvent *) xi_event;
+
+ /* This is the only way to attribute core keyboard
+ events generated on GTK+ 2.x to the extension device
+ that generated them. */
+ dpyinfo->pending_keystroke_time = raw_event->time;
+ dpyinfo->pending_keystroke_source = raw_event->sourceid;
+ dpyinfo->pending_keystroke_time_special_p = true;
+ goto XI_OTHER;
+ }
+#endif
+
case XI_KeyRelease:
#if defined HAVE_X_I18N || defined USE_GTK
{
Time pending_keystroke_time;
int pending_keystroke_source;
+
+#if defined USE_GTK && !defined HAVE_GTK3
+ /* This means the two variables above shouldn't be reset the first
+ time a KeyPress event arrives, since they were set from a raw key
+ press event that was sent before the first (real, not sent by an
+ input method) core key event. */
+ bool pending_keystroke_time_special_p;
+#endif
#endif
#ifdef HAVE_XKB