clutter/evdev: ignore injected events from IM
authorOlivier Fourdan <ofourdan@redhat.com>
Tue, 17 Apr 2018 11:32:21 +0000 (13:32 +0200)
committerSimon McVittie <smcv@debian.org>
Sun, 20 May 2018 14:21:35 +0000 (15:21 +0100)
Input method can inject key events, which leads to multiple reported key
press/release events for a single user action.

Ignore those events as this confuses keyboard accessibility.

(cherry picked from commit c01b099dbdfee4b2a98864bc76bfa1b96a55c8fb)

Origin: upstream, 3.28.3, commit:c7a38c31398871d2461b66963756816d268f524e

Gbp-Pq: Name clutter-evdev-ignore-injected-events-from-IM.patch

clutter/clutter/evdev/clutter-input-device-evdev.c

index 6c52361ee8a8c12a3d36c862cc053bc3f871d9a6..e5dee650f352b932615fb674a6e09ded06c55521 100644 (file)
@@ -1122,6 +1122,10 @@ clutter_input_device_evdev_process_kbd_a11y_event (ClutterEvent               *e
 {
   ClutterInputDeviceEvdev *device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
 
+  /* Ignore key events injected from IM */
+  if (event->key.flags & CLUTTER_EVENT_FLAG_INPUT_METHOD)
+    goto emit_event;
+
   if (!device_evdev->a11y_flags & CLUTTER_A11Y_KEYBOARD_ENABLED)
     goto emit_event;