forked from enlightenment/efl
elput: Improve debug output for added devices
Small patch which does not print out debug info for devices we do not handle, and adds the 'type' of device to the debug output (pointer, keyboard, etc). @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
df1a1e05a9
commit
e483e35f3d
|
@ -176,6 +176,12 @@ _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);
|
||||||
|
|
||||||
|
DBG("Input Device Added: %s", libinput_device_get_name(dev));
|
||||||
if (edev->caps & EVDEV_SEAT_KEYBOARD)
|
if (edev->caps & EVDEV_SEAT_KEYBOARD)
|
||||||
DBG("\tDevice added as Keyboard device");
|
DBG("\tDevice added as Keyboard device");
|
||||||
if (edev->caps & EVDEV_SEAT_POINTER)
|
if (edev->caps & EVDEV_SEAT_POINTER)
|
||||||
|
@ -183,11 +189,6 @@ _device_add(Elput_Manager *em, struct libinput_device *dev)
|
||||||
if (edev->caps & EVDEV_SEAT_TOUCH)
|
if (edev->caps & EVDEV_SEAT_TOUCH)
|
||||||
DBG("\tDevice added as Touch device");
|
DBG("\tDevice added as Touch device");
|
||||||
|
|
||||||
oname = libinput_device_get_output_name(dev);
|
|
||||||
eina_stringshare_replace(&edev->output_name, oname);
|
|
||||||
|
|
||||||
eseat->devices = eina_list_append(eseat->devices, edev);
|
|
||||||
|
|
||||||
_device_event_send(edev, ELPUT_DEVICE_ADDED);
|
_device_event_send(edev, ELPUT_DEVICE_ADDED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,6 +200,8 @@ _device_remove(Elput_Manager *em EINA_UNUSED, struct libinput_device *device)
|
||||||
edev = libinput_device_get_user_data(device);
|
edev = libinput_device_get_user_data(device);
|
||||||
if (!edev) return;
|
if (!edev) return;
|
||||||
|
|
||||||
|
DBG("Input Device Removed: %s", libinput_device_get_name(device));
|
||||||
|
|
||||||
_device_event_send(edev, ELPUT_DEVICE_REMOVED);
|
_device_event_send(edev, ELPUT_DEVICE_REMOVED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,11 +220,9 @@ _udev_process_event(struct libinput_event *event)
|
||||||
switch (libinput_event_get_type(event))
|
switch (libinput_event_get_type(event))
|
||||||
{
|
{
|
||||||
case LIBINPUT_EVENT_DEVICE_ADDED:
|
case LIBINPUT_EVENT_DEVICE_ADDED:
|
||||||
DBG("Input Device Added: %s", libinput_device_get_name(dev));
|
|
||||||
_device_add(em, dev);
|
_device_add(em, dev);
|
||||||
break;
|
break;
|
||||||
case LIBINPUT_EVENT_DEVICE_REMOVED:
|
case LIBINPUT_EVENT_DEVICE_REMOVED:
|
||||||
DBG("Input Device Removed: %s", libinput_device_get_name(dev));
|
|
||||||
_device_remove(em, dev);
|
_device_remove(em, dev);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue