clutter/evdev: Implement togglekeys notification

Notify with a system sound when the modifiers lock state is changed.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/637
This commit is contained in:
Olivier Fourdan 2019-06-12 11:59:41 +02:00
parent 36155f72d0
commit 02fc0b4533
3 changed files with 9 additions and 0 deletions

View File

@ -1246,6 +1246,13 @@ clutter_input_device_evdev_apply_kbd_a11y_settings (ClutterInputDeviceEvdev *dev
device->a11y_flags = settings->controls; device->a11y_flags = settings->controls;
} }
void
clutter_evdev_a11y_maybe_notify_toggle_keys (ClutterInputDeviceEvdev *device)
{
if (device->a11y_flags & CLUTTER_A11Y_TOGGLE_KEYS_ENABLED)
clutter_input_device_evdev_bell_notify ();
}
static void static void
release_device_touch_slot (gpointer value) release_device_touch_slot (gpointer value)
{ {

View File

@ -150,6 +150,7 @@ void clutter_input_device_evdev_release_touch_state (Clutte
void clutter_input_device_evdev_release_touch_slots (ClutterInputDeviceEvdev *device_evdev, void clutter_input_device_evdev_release_touch_slots (ClutterInputDeviceEvdev *device_evdev,
uint64_t time_us); uint64_t time_us);
void clutter_evdev_a11y_maybe_notify_toggle_keys (ClutterInputDeviceEvdev *);
G_END_DECLS G_END_DECLS

View File

@ -326,6 +326,7 @@ clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat,
backend = clutter_get_default_backend (); backend = clutter_get_default_backend ();
g_signal_emit_by_name (clutter_backend_get_keymap (backend), "state-changed"); g_signal_emit_by_name (clutter_backend_get_keymap (backend), "state-changed");
clutter_seat_evdev_sync_leds (seat); clutter_seat_evdev_sync_leds (seat);
clutter_evdev_a11y_maybe_notify_toggle_keys (CLUTTER_INPUT_DEVICE_EVDEV (seat->core_keyboard));
} }
if (state == 0 || /* key release */ if (state == 0 || /* key release */