diff --git a/clutter/clutter/evdev/clutter-device-manager-evdev.c b/clutter/clutter/evdev/clutter-device-manager-evdev.c index c3fdc90aa..479f86937 100644 --- a/clutter/clutter/evdev/clutter-device-manager-evdev.c +++ b/clutter/clutter/evdev/clutter-device-manager-evdev.c @@ -2602,6 +2602,21 @@ clutter_evdev_set_keyboard_layout_index (ClutterDeviceManager *evdev, xkb_state_update_mask (state, depressed_mods, latched_mods, locked_mods, 0, 0, idx); } +/** + * clutter_evdev_get_keyboard_layout_index: (skip) + */ +xkb_layout_index_t +clutter_evdev_get_keyboard_layout_index (ClutterDeviceManager *evdev) +{ + ClutterDeviceManagerEvdev *manager_evdev; + struct xkb_state *state; + + manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev); + state = manager_evdev->priv->main_seat->xkb; + + return xkb_state_serialize_layout (state, XKB_STATE_LAYOUT_LOCKED); +} + /** * clutter_evdev_set_keyboard_numlock: (skip) * @evdev: the #ClutterDeviceManager created by the evdev backend diff --git a/clutter/clutter/evdev/clutter-evdev.h b/clutter/clutter/evdev/clutter-evdev.h index b64b1364b..be7f09c44 100644 --- a/clutter/clutter/evdev/clutter-evdev.h +++ b/clutter/clutter/evdev/clutter-evdev.h @@ -120,6 +120,9 @@ CLUTTER_AVAILABLE_IN_1_20 void clutter_evdev_set_keyboard_layout_index (ClutterDeviceManager *evdev, xkb_layout_index_t idx); +CLUTTER_AVAILABLE_IN_MUTTER +xkb_layout_index_t clutter_evdev_get_keyboard_layout_index (ClutterDeviceManager *evdev); + CLUTTER_AVAILABLE_IN_1_26 void clutter_evdev_set_keyboard_numlock (ClutterDeviceManager *evdev, gboolean numlock_state);