summaryrefslogtreecommitdiff
path: root/src/lib/elput
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-01-31 10:34:22 -0500
committerChris Michael <cp.michael@samsung.com>2017-01-31 10:34:22 -0500
commitcee7ee39932c31a21d3dd90e19703371a946a0c0 (patch)
treeb29095ee9339eda698a74198f41088c17c579b40 /src/lib/elput
parent7b8343253970f8a98d1386a9a354529274c3cd2b (diff)
elput: Change return of device_add/remove functions
Minor change on the return value of the device_add and device_remove functions so that we can avoid debug output for devices which we do not deal with. Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/elput')
-rw-r--r--src/lib/elput/elput_input.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index 6bb5b579e3..5f5168e657 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -163,7 +163,7 @@ _device_event_send(Elput_Device *edev, Elput_Device_Change_Type type)
163 ecore_event_add(ELPUT_EVENT_DEVICE_CHANGE, ev, _device_event_cb_free, NULL); 163 ecore_event_add(ELPUT_EVENT_DEVICE_CHANGE, ev, _device_event_cb_free, NULL);
164} 164}
165 165
166static void 166static Eina_Bool
167_device_add(Elput_Manager *em, struct libinput_device *dev) 167_device_add(Elput_Manager *em, struct libinput_device *dev)
168{ 168{
169 Elput_Seat *eseat; 169 Elput_Seat *eseat;
@@ -171,10 +171,10 @@ _device_add(Elput_Manager *em, struct libinput_device *dev)
171 const char *oname; 171 const char *oname;
172 172
173 eseat = _udev_seat_get(em, dev); 173 eseat = _udev_seat_get(em, dev);
174 if (!eseat) return; 174 if (!eseat) return EINA_FALSE;
175 175
176 edev = _evdev_device_create(eseat, dev); 176 edev = _evdev_device_create(eseat, dev);
177 if (!edev) return; 177 if (!edev) return EINA_FALSE;
178 178
179 if (edev->caps & EVDEV_SEAT_KEYBOARD) 179 if (edev->caps & EVDEV_SEAT_KEYBOARD)
180 DBG("\tDevice added as Keyboard device"); 180 DBG("\tDevice added as Keyboard device");
@@ -189,17 +189,21 @@ _device_add(Elput_Manager *em, struct libinput_device *dev)
189 eseat->devices = eina_list_append(eseat->devices, edev); 189 eseat->devices = eina_list_append(eseat->devices, edev);
190 190
191 _device_event_send(edev, ELPUT_DEVICE_ADDED); 191 _device_event_send(edev, ELPUT_DEVICE_ADDED);
192
193 return EINA_TRUE;
192} 194}
193 195
194static void 196static Eina_Bool
195_device_remove(Elput_Manager *em EINA_UNUSED, struct libinput_device *device) 197_device_remove(Elput_Manager *em EINA_UNUSED, struct libinput_device *device)
196{ 198{
197 Elput_Device *edev; 199 Elput_Device *edev;
198 200
199 edev = libinput_device_get_user_data(device); 201 edev = libinput_device_get_user_data(device);
200 if (!edev) return; 202 if (!edev) return EINA_FALSE;
201 203
202 _device_event_send(edev, ELPUT_DEVICE_REMOVED); 204 _device_event_send(edev, ELPUT_DEVICE_REMOVED);
205
206 return EINA_TRUE;
203} 207}
204 208
205static int 209static int
@@ -217,12 +221,12 @@ _udev_process_event(struct libinput_event *event)
217 switch (libinput_event_get_type(event)) 221 switch (libinput_event_get_type(event))
218 { 222 {
219 case LIBINPUT_EVENT_DEVICE_ADDED: 223 case LIBINPUT_EVENT_DEVICE_ADDED:
220 DBG("Input Device Added: %s", libinput_device_get_name(dev)); 224 if (_device_add(em, dev))
221 _device_add(em, dev); 225 DBG("Input Device Added: %s", libinput_device_get_name(dev));
222 break; 226 break;
223 case LIBINPUT_EVENT_DEVICE_REMOVED: 227 case LIBINPUT_EVENT_DEVICE_REMOVED:
224 DBG("Input Device Removed: %s", libinput_device_get_name(dev)); 228 if (_device_remove(em, dev))
225 _device_remove(em, dev); 229 DBG("Input Device Removed: %s", libinput_device_get_name(dev));
226 break; 230 break;
227 default: 231 default:
228 ret = 0; 232 ret = 0;