forked from enlightenment/efl
elput: Add API function to support caching of an xkb_context
@feature Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This commit is contained in:
parent
ec464939d9
commit
65cfdaa3dd
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -247,6 +247,11 @@ struct _Elput_Manager
|
|||
Eldbus_Proxy *manager;
|
||||
} dbus;
|
||||
|
||||
struct
|
||||
{
|
||||
struct xkb_context *context;
|
||||
} cached;
|
||||
|
||||
Elput_Input input;
|
||||
Eina_Bool del : 1;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue