forked from enlightenment/efl
elput: Set device output name when device is created
Small patch to set the output name of an Elput_Device when the device gets created. Note, this was already being done inside elput_input, but this patch moves it to when the device gets created. NB: Really no functional changes here, just moving a function call. Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
e9b8dcf442
commit
661c19a514
|
@ -1252,6 +1252,7 @@ Elput_Device *
|
||||||
_evdev_device_create(Elput_Seat *seat, struct libinput_device *device)
|
_evdev_device_create(Elput_Seat *seat, struct libinput_device *device)
|
||||||
{
|
{
|
||||||
Elput_Device *edev;
|
Elput_Device *edev;
|
||||||
|
const char *oname;
|
||||||
|
|
||||||
edev = calloc(1, sizeof(Elput_Device));
|
edev = calloc(1, sizeof(Elput_Device));
|
||||||
if (!edev) return NULL;
|
if (!edev) return NULL;
|
||||||
|
@ -1260,6 +1261,9 @@ _evdev_device_create(Elput_Seat *seat, struct libinput_device *device)
|
||||||
edev->device = device;
|
edev->device = device;
|
||||||
edev->caps = 0;
|
edev->caps = 0;
|
||||||
|
|
||||||
|
oname = libinput_device_get_output_name(device);
|
||||||
|
eina_stringshare_replace(&edev->output_name, oname);
|
||||||
|
|
||||||
if ((libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) &&
|
if ((libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) &&
|
||||||
(libinput_device_keyboard_has_key(device, KEY_ENTER)))
|
(libinput_device_keyboard_has_key(device, KEY_ENTER)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -168,7 +168,6 @@ _device_add(Elput_Manager *em, struct libinput_device *dev)
|
||||||
{
|
{
|
||||||
Elput_Seat *eseat;
|
Elput_Seat *eseat;
|
||||||
Elput_Device *edev;
|
Elput_Device *edev;
|
||||||
const char *oname;
|
|
||||||
|
|
||||||
eseat = _udev_seat_get(em, dev);
|
eseat = _udev_seat_get(em, dev);
|
||||||
if (!eseat) return;
|
if (!eseat) return;
|
||||||
|
@ -176,9 +175,6 @@ _device_add(Elput_Manager *em, struct libinput_device *dev)
|
||||||
edev = _evdev_device_create(eseat, dev);
|
edev = _evdev_device_create(eseat, dev);
|
||||||
if (!edev) return;
|
if (!edev) return;
|
||||||
|
|
||||||
oname = libinput_device_get_output_name(dev);
|
|
||||||
eina_stringshare_replace(&edev->output_name, oname);
|
|
||||||
|
|
||||||
eseat->devices = eina_list_append(eseat->devices, edev);
|
eseat->devices = eina_list_append(eseat->devices, edev);
|
||||||
|
|
||||||
DBG("Input Device Added: %s", libinput_device_get_name(dev));
|
DBG("Input Device Added: %s", libinput_device_get_name(dev));
|
||||||
|
|
Loading…
Reference in New Issue