summaryrefslogtreecommitdiff
path: root/src/lib/elput
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-02-07 11:33:25 -0500
committerChris Michael <cp.michael@samsung.com>2017-02-07 11:33:25 -0500
commit661c19a514b8ccb0c0e31a31b5cf9b945b401cf6 (patch)
tree761d6d3aef3d00ea87349ef4c3445b78330a49eb /src/lib/elput
parente9b8dcf442d65b13e9db4cf0ba8b4f72721205d6 (diff)
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>
Diffstat (limited to 'src/lib/elput')
-rw-r--r--src/lib/elput/elput_evdev.c4
-rw-r--r--src/lib/elput/elput_input.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index 9580f49909..b022a6fe0d 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -1252,6 +1252,7 @@ Elput_Device *
1252_evdev_device_create(Elput_Seat *seat, struct libinput_device *device) 1252_evdev_device_create(Elput_Seat *seat, struct libinput_device *device)
1253{ 1253{
1254 Elput_Device *edev; 1254 Elput_Device *edev;
1255 const char *oname;
1255 1256
1256 edev = calloc(1, sizeof(Elput_Device)); 1257 edev = calloc(1, sizeof(Elput_Device));
1257 if (!edev) return NULL; 1258 if (!edev) return NULL;
@@ -1260,6 +1261,9 @@ _evdev_device_create(Elput_Seat *seat, struct libinput_device *device)
1260 edev->device = device; 1261 edev->device = device;
1261 edev->caps = 0; 1262 edev->caps = 0;
1262 1263
1264 oname = libinput_device_get_output_name(device);
1265 eina_stringshare_replace(&edev->output_name, oname);
1266
1263 if ((libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) && 1267 if ((libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) &&
1264 (libinput_device_keyboard_has_key(device, KEY_ENTER))) 1268 (libinput_device_keyboard_has_key(device, KEY_ENTER)))
1265 { 1269 {
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index c854fc9a63..cc29cfc4a6 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -168,7 +168,6 @@ _device_add(Elput_Manager *em, struct libinput_device *dev)
168{ 168{
169 Elput_Seat *eseat; 169 Elput_Seat *eseat;
170 Elput_Device *edev; 170 Elput_Device *edev;
171 const char *oname;
172 171
173 eseat = _udev_seat_get(em, dev); 172 eseat = _udev_seat_get(em, dev);
174 if (!eseat) return; 173 if (!eseat) return;
@@ -176,9 +175,6 @@ _device_add(Elput_Manager *em, struct libinput_device *dev)
176 edev = _evdev_device_create(eseat, dev); 175 edev = _evdev_device_create(eseat, dev);
177 if (!edev) return; 176 if (!edev) return;
178 177
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); 178 eseat->devices = eina_list_append(eseat->devices, edev);
183 179
184 DBG("Input Device Added: %s", libinput_device_get_name(dev)); 180 DBG("Input Device Added: %s", libinput_device_get_name(dev));