[mutter] clutter/evdev: Fix toggling accessibility features from keyboard



commit 5c27bf6a2b45dde52b00b269c6cd5816dea7fb0f
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 8caf09572..325881287 100644
--- a/clutter/clutter/evdev/clutter-input-device-evdev.c
+++ b/clutter/clutter/evdev/clutter-input-device-evdev.c
@@ -676,7 +676,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)
@@ -698,7 +698,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)
@@ -1135,6 +1135,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 &&
@@ -1145,14 +1150,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]