* src/gtkutil.c (xg_filter_key): Set correct event type for key
release events.
* src/xterm.c (x_filter_event): Also filter release events.
bool
xg_filter_key (struct frame *frame, XEvent *xkey)
{
- GdkEvent *xg_event = gdk_event_new (GDK_KEY_PRESS);
+ GdkEvent *xg_event = gdk_event_new ((xkey->type == ButtonPress
+#ifdef HAVE_XINPUT2
+ || (xkey->type == GenericEvent
+ && xkey->xgeneric.evtype == XI_KeyPress)
+#endif
+ ) ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
GdkDisplay *dpy = gtk_widget_get_display (FRAME_GTK_WIDGET (frame));
GdkKeymap *keymap = gdk_keymap_get_for_display (dpy);
GdkModifierType consumed;
&& event->type == GenericEvent
&& (event->xgeneric.extension
== dpyinfo->xi2_opcode)
- && (event->xgeneric.evtype
- == XI_KeyPress))
+ && ((event->xgeneric.evtype
+ == XI_KeyPress)
+ || (event->xgeneric.evtype
+ == XI_KeyRelease)))
{
f1 = x_any_window_to_frame (dpyinfo,
((XIDeviceEvent *)