[mutter/wip/garnacho/virtual-input-device: 92/94] clutter/evdev: Update xkb state on main seat too
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/garnacho/virtual-input-device: 92/94] clutter/evdev: Update xkb state on main seat too
- Date: Wed, 20 Jul 2016 16:34:07 +0000 (UTC)
commit 3965e40ac8543893c09487f6ada3532989389f9f
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Jul 20 17:59:07 2016 +0200
clutter/evdev: Update xkb state on main seat too
The per-seat updating code has been separated into a function, so
it can be used with both the main and additional seats.
.../clutter/evdev/clutter-device-manager-evdev.c | 54 ++++++++++++--------
1 files changed, 33 insertions(+), 21 deletions(-)
---
diff --git a/clutter/clutter/evdev/clutter-device-manager-evdev.c
b/clutter/clutter/evdev/clutter-device-manager-evdev.c
index 9d364ef..e7947dc 100644
--- a/clutter/clutter/evdev/clutter-device-manager-evdev.c
+++ b/clutter/clutter/evdev/clutter-device-manager-evdev.c
@@ -2130,38 +2130,50 @@ clutter_evdev_release_devices (void)
}
static void
-clutter_evdev_update_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
+seat_update_xkb_state (ClutterSeatEvdev *seat)
{
+ ClutterDeviceManagerEvdev *manager_evdev = seat->manager_evdev;
ClutterDeviceManagerEvdevPrivate *priv;
- GSList *iter;
- ClutterSeatEvdev *seat;
xkb_mod_mask_t latched_mods;
xkb_mod_mask_t locked_mods;
priv = manager_evdev->priv;
+ latched_mods = xkb_state_serialize_mods (seat->xkb,
+ XKB_STATE_MODS_LATCHED);
+ locked_mods = xkb_state_serialize_mods (seat->xkb,
+ XKB_STATE_MODS_LOCKED);
+ xkb_state_unref (seat->xkb);
+ seat->xkb = xkb_state_new (priv->keymap);
- for (iter = priv->seats; iter; iter = iter->next)
- {
- seat = iter->data;
+ xkb_state_update_mask (seat->xkb,
+ 0, /* depressed */
+ latched_mods,
+ locked_mods,
+ 0, 0, 0);
+
+ seat->caps_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_CAPS);
+ seat->num_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_NUM);
+ seat->scroll_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_SCROLL);
- latched_mods = xkb_state_serialize_mods (seat->xkb,
- XKB_STATE_MODS_LATCHED);
- locked_mods = xkb_state_serialize_mods (seat->xkb,
- XKB_STATE_MODS_LOCKED);
- xkb_state_unref (seat->xkb);
- seat->xkb = xkb_state_new (priv->keymap);
+ clutter_seat_evdev_sync_leds (seat);
+}
+
+static void
+clutter_evdev_update_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
+{
+ ClutterDeviceManagerEvdevPrivate *priv;
+ GSList *iter;
+ ClutterSeatEvdev *seat;
- xkb_state_update_mask (seat->xkb,
- 0, /* depressed */
- latched_mods,
- locked_mods,
- 0, 0, 0);
+ priv = manager_evdev->priv;
- seat->caps_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_CAPS);
- seat->num_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_NUM);
- seat->scroll_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_SCROLL);
+ if (priv->main_seat)
+ seat_update_xkb_state (priv->main_seat);
- clutter_seat_evdev_sync_leds (seat);
+ for (iter = priv->seats; iter; iter = iter->next)
+ {
+ seat = iter->data;
+ seat_update_xkb_state (seat);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]