From: Olivier Fourdan Date: Wed, 20 Mar 2019 17:32:28 +0000 (+0100) Subject: clutter/evdev: Fix toggling accessibility features from keyboard X-Git-Tag: archive/raspbian/3.30.2-7+rpi1^2~9 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3a6ecb970e527da18f4652c1d65ffdd21b1cdd62;p=mutter.git clutter/evdev: Fix toggling accessibility features from keyboard Enabling keyboard accessibility features on Wayland from the keyboard was wrongly assumed to be controlled by the "togglekeys" setting, whereas it should be simply controlled by the "enable" setting. As "togglekeys" is off by default and doesn't have a UI option to enable, that would prevent turning on or off the keyboard accessibility features using the keyboard. Bug: https://gitlab.gnome.org/GNOME/mutter/merge_requests/501 Origin: upstream, 3.30.3, commit:6be39612991d973f69b5dc652076acbe94f49f99 Gbp-Pq: Name clutter-evdev-Fix-toggling-accessibility-features-from-ke.patch --- diff --git a/clutter/clutter/evdev/clutter-input-device-evdev.c b/clutter/clutter/evdev/clutter-input-device-evdev.c index 1f45afd..b4e1445 100644 --- a/clutter/clutter/evdev/clutter-input-device-evdev.c +++ b/clutter/clutter/evdev/clutter-input-device-evdev.c @@ -677,7 +677,7 @@ stop_toggle_slowkeys (ClutterInputDeviceEvdev *device) } static void -handle_togglekeys_press (ClutterEvent *event, +handle_enablekeys_press (ClutterEvent *event, ClutterInputDeviceEvdev *device) { if (event->key.keyval == XKB_KEY_Shift_L || event->key.keyval == XKB_KEY_Shift_R) @@ -699,7 +699,7 @@ handle_togglekeys_press (ClutterEvent *event, } static void -handle_togglekeys_release (ClutterEvent *event, +handle_enablekeys_release (ClutterEvent *event, ClutterInputDeviceEvdev *device) { if (event->key.keyval == XKB_KEY_Shift_L || event->key.keyval == XKB_KEY_Shift_R) @@ -1136,6 +1136,11 @@ clutter_input_device_evdev_process_kbd_a11y_event (ClutterEvent *e if (!device_evdev->a11y_flags & CLUTTER_A11Y_KEYBOARD_ENABLED) goto emit_event; + if (event->type == CLUTTER_KEY_PRESS) + handle_enablekeys_press (event, device_evdev); + else + handle_enablekeys_release (event, device_evdev); + if (device_evdev->a11y_flags & CLUTTER_A11Y_MOUSE_KEYS_ENABLED) { if (event->type == CLUTTER_KEY_PRESS && @@ -1146,14 +1151,6 @@ clutter_input_device_evdev_process_kbd_a11y_event (ClutterEvent *e return; /* swallow event */ } - if (device_evdev->a11y_flags & CLUTTER_A11Y_TOGGLE_KEYS_ENABLED) - { - if (event->type == CLUTTER_KEY_PRESS) - handle_togglekeys_press (event, device_evdev); - else - handle_togglekeys_release (event, device_evdev); - } - if ((device_evdev->a11y_flags & CLUTTER_A11Y_BOUNCE_KEYS_ENABLED) && (get_debounce_delay (device) != 0)) {