devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=65cfdaa3ddf17f0d5b3d8750e5ae2da026098b20
commit 65cfdaa3ddf17f0d5b3d8750e5ae2da026098b20 Author: Chris Michael <cpmich...@osg.samsung.com> Date: Fri May 27 09:12:53 2016 -0400 elput: Add API function to support caching of an xkb_context @feature Signed-off-by: Chris Michael <cpmich...@osg.samsung.com> --- src/lib/elput/Elput.h | 11 +++++++++++ src/lib/elput/elput_evdev.c | 3 ++- src/lib/elput/elput_input.c | 9 +++++++++ src/lib/elput/elput_private.h | 5 +++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h index a7f0b7e..f64943f 100644 --- a/src/lib/elput/Elput.h +++ b/src/lib/elput/Elput.h @@ -379,6 +379,17 @@ EAPI Eina_Bool elput_input_key_remap_enable(Elput_Manager *manager, Eina_Bool en */ EAPI Eina_Bool elput_input_key_remap_set(Elput_Manager *manager, int *from_keys, int *to_keys, int num); +/** + * Set a cached context to be used for keyboards + * + * @param manager + * @param context + * + * @ingroup Elput_Input_Group + * @since 1.18 + */ +EAPI void elput_input_keyboard_cached_context_set(Elput_Manager *manager, void *context); + # endif # undef EAPI diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c index c083a17..79386af 100644 --- a/src/lib/elput/elput_evdev.c +++ b/src/lib/elput/elput_evdev.c @@ -206,6 +206,7 @@ _keyboard_create(Elput_Seat *seat) if (!kbd) return NULL; kbd->seat = seat; + return kbd; } @@ -1247,7 +1248,7 @@ _evdev_device_create(Elput_Seat *seat, struct libinput_device *device) if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) { - _keyboard_init(seat, NULL); + _keyboard_init(seat, seat->manager->cached.keymap); edev->caps |= EVDEV_SEAT_KEYBOARD; } diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c index e838c9b..464f69f 100644 --- a/src/lib/elput/elput_input.c +++ b/src/lib/elput/elput_input.c @@ -576,3 +576,12 @@ elput_input_key_remap_set(Elput_Manager *manager, int *from_keys, int *to_keys, return EINA_TRUE; } + +EAPI void +elput_input_keyboard_cached_context_set(Elput_Manager *manager, void *context) +{ + EINA_SAFETY_ON_NULL_RETURN(manager); + + if ((context) && (manager->cached.context == context)) return; + manager->cached.context = context; +} diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h index 2d9de14..7a57e2f 100644 --- a/src/lib/elput/elput_private.h +++ b/src/lib/elput/elput_private.h @@ -247,6 +247,11 @@ struct _Elput_Manager Eldbus_Proxy *manager; } dbus; + struct + { + struct xkb_context *context; + } cached; + Elput_Input input; Eina_Bool del : 1; }; --