summaryrefslogtreecommitdiff
path: root/src/lib/elput
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-01-31 10:55:55 -0500
committerChris Michael <cp.michael@samsung.com>2017-01-31 10:55:55 -0500
commite483e35f3dd898085eadf1f70a94e80bbd987759 (patch)
treeefc9ea35b335c86c6c02a6160697580a5c97a976 /src/lib/elput
parentdf1a1e05a95e24ef7d9704362b6c35e5ae8678e6 (diff)
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>
Diffstat (limited to 'src/lib/elput')
-rw-r--r--src/lib/elput/elput_input.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index 6bb5b579e3..c854fc9a63 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -176,6 +176,12 @@ _device_add(Elput_Manager *em, struct libinput_device *dev)
176 edev = _evdev_device_create(eseat, dev); 176 edev = _evdev_device_create(eseat, dev);
177 if (!edev) return; 177 if (!edev) return;
178 178
179 oname = libinput_device_get_output_name(dev);
180 eina_stringshare_replace(&edev->output_name, oname);
181
182 eseat->devices = eina_list_append(eseat->devices, edev);
183
184 DBG("Input Device Added: %s", libinput_device_get_name(dev));
179 if (edev->caps & EVDEV_SEAT_KEYBOARD) 185 if (edev->caps & EVDEV_SEAT_KEYBOARD)
180 DBG("\tDevice added as Keyboard device"); 186 DBG("\tDevice added as Keyboard device");
181 if (edev->caps & EVDEV_SEAT_POINTER) 187 if (edev->caps & EVDEV_SEAT_POINTER)
@@ -183,11 +189,6 @@ _device_add(Elput_Manager *em, struct libinput_device *dev)
183 if (edev->caps & EVDEV_SEAT_TOUCH) 189 if (edev->caps & EVDEV_SEAT_TOUCH)
184 DBG("\tDevice added as Touch device"); 190 DBG("\tDevice added as Touch device");
185 191
186 oname = libinput_device_get_output_name(dev);
187 eina_stringshare_replace(&edev->output_name, oname);
188
189 eseat->devices = eina_list_append(eseat->devices, edev);
190
191 _device_event_send(edev, ELPUT_DEVICE_ADDED); 192 _device_event_send(edev, ELPUT_DEVICE_ADDED);
192} 193}
193 194
@@ -199,6 +200,8 @@ _device_remove(Elput_Manager *em EINA_UNUSED, struct libinput_device *device)
199 edev = libinput_device_get_user_data(device); 200 edev = libinput_device_get_user_data(device);
200 if (!edev) return; 201 if (!edev) return;
201 202
203 DBG("Input Device Removed: %s", libinput_device_get_name(device));
204
202 _device_event_send(edev, ELPUT_DEVICE_REMOVED); 205 _device_event_send(edev, ELPUT_DEVICE_REMOVED);
203} 206}
204 207
@@ -217,11 +220,9 @@ _udev_process_event(struct libinput_event *event)
217 switch (libinput_event_get_type(event)) 220 switch (libinput_event_get_type(event))
218 { 221 {
219 case LIBINPUT_EVENT_DEVICE_ADDED: 222 case LIBINPUT_EVENT_DEVICE_ADDED:
220 DBG("Input Device Added: %s", libinput_device_get_name(dev));
221 _device_add(em, dev); 223 _device_add(em, dev);
222 break; 224 break;
223 case LIBINPUT_EVENT_DEVICE_REMOVED: 225 case LIBINPUT_EVENT_DEVICE_REMOVED:
224 DBG("Input Device Removed: %s", libinput_device_get_name(dev));
225 _device_remove(em, dev); 226 _device_remove(em, dev);
226 break; 227 break;
227 default: 228 default: