[mutter/gnome-3-30] clutter/evdev: Fix toggling accessibility features from keyboard



commit 6be39612991d973f69b5dc652076acbe94f49f99
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Wed Mar 20 18:32:28 2019 +0100

    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.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/501

 clutter/clutter/evdev/clutter-input-device-evdev.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/clutter/clutter/evdev/clutter-input-device-evdev.c 
b/clutter/clutter/evdev/clutter-input-device-evdev.c
index 1f45afded..b4e144592 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))
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]