summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-12-23 14:51:01 +0100
committerRobert Mader <robert.mader@collabora.com>2023-01-06 13:50:41 +0100
commit01969a77ee33519dbd6159393eb43ee40e040cda (patch)
treee5c34093a5e26940885829fc329fa8555f760f63
parent36549b45fd8f824580668654000897c86d451147 (diff)
downloadmutter-01969a77ee33519dbd6159393eb43ee40e040cda.tar.gz
backends/native: Set up keyboard a11y when keyboards are plugged
Commit 4e0ffba5c attempted to fix initialization of keyboard a11y, but mousekeys do attempt to create a virtual input device at a time that it is too early to try to create one. Defer this operation until keyboard devices are added, so that we are ensured to already have the seat input thread set up. Fixes: 4e0ffba5c - backends/native: Initialize keyboard a11y on startup Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2778> (cherry-picked from commit 717ee78997144e8c8497d1a4e2570cfccc1288ce)
-rw-r--r--src/backends/native/meta-seat-impl.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
index 886cfc497..23865c905 100644
--- a/src/backends/native/meta-seat-impl.c
+++ b/src/backends/native/meta-seat-impl.c
@@ -1733,6 +1733,18 @@ evdev_add_device (MetaSeatImpl *seat_impl,
if (is_touchscreen || is_tablet_switch || is_pointer)
update_touch_mode (seat_impl);
+ if (type == CLUTTER_KEYBOARD_DEVICE)
+ {
+ MetaKbdA11ySettings kbd_a11y_settings;
+ MetaInputDeviceNative *keyboard_native;
+
+ keyboard_native = META_INPUT_DEVICE_NATIVE (seat_impl->core_keyboard);
+ meta_input_settings_get_kbd_a11y_settings (seat_impl->input_settings,
+ &kbd_a11y_settings);
+ meta_input_device_native_apply_kbd_a11y_settings_in_impl (keyboard_native,
+ &kbd_a11y_settings);
+ }
+
return device;
}
@@ -2818,8 +2830,6 @@ input_thread (MetaSeatImpl *seat_impl)
{
MetaSeatImplPrivate *priv = meta_seat_impl_get_instance_private (seat_impl);
struct xkb_keymap *xkb_keymap;
- MetaKbdA11ySettings kbd_a11y_settings;
- MetaInputDeviceNative *keyboard_native;
g_main_context_push_thread_default (seat_impl->input_context);
@@ -2867,12 +2877,6 @@ input_thread (MetaSeatImpl *seat_impl)
seat_impl->has_tablet_switch = has_tablet_switch (seat_impl);
update_touch_mode (seat_impl);
- keyboard_native = META_INPUT_DEVICE_NATIVE (seat_impl->core_keyboard);
- meta_input_settings_get_kbd_a11y_settings (seat_impl->input_settings,
- &kbd_a11y_settings);
- meta_input_device_native_apply_kbd_a11y_settings_in_impl (keyboard_native,
- &kbd_a11y_settings);
-
g_mutex_lock (&seat_impl->init_mutex);
seat_impl->input_thread_initialized = TRUE;
g_cond_signal (&seat_impl->init_cond);