summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm_evdev.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-04-22 14:32:16 -0400
committerChris Michael <cp.michael@samsung.com>2015-04-22 14:32:16 -0400
commit67460e2d78c88f525f15620ae7a583b21fc997d4 (patch)
tree51fdff66260f5d16581ec64a45432a8e2d8f8c55 /src/lib/ecore_drm/ecore_drm_evdev.c
parent0d1d62a6ab35ab22bd873dafffbf5b1469e4572e (diff)
ecore_drm: Don't crash if a device is assigned a bad output
Summary: If an input device is assigned via udev to an output that we can't find we just assign it to the first output instead. Reviewers: zmike, devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2408
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm/ecore_drm_evdev.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_evdev.c b/src/lib/ecore_drm/ecore_drm_evdev.c
index 9f4651649a..04275fdb70 100644
--- a/src/lib/ecore_drm/ecore_drm_evdev.c
+++ b/src/lib/ecore_drm/ecore_drm_evdev.c
@@ -65,20 +65,16 @@ _device_output_set(Ecore_Drm_Evdev *edev)
65 DBG("Device Has Output Name: %s", oname); 65 DBG("Device Has Output Name: %s", oname);
66 66
67 EINA_LIST_FOREACH(input->dev->outputs, l, output) 67 EINA_LIST_FOREACH(input->dev->outputs, l, output)
68 { 68 if ((output->name) && (!strcmp(output->name, oname))) break;
69 if ((output->name) && (!strcmp(output->name, oname)))
70 {
71 edev->output = output;
72 break;
73 }
74 }
75 }
76 else
77 {
78 if (!(output = eina_list_nth(input->dev->outputs, 0))) return;
79 edev->output = output;
80 } 69 }
81 70
71 if (!output)
72 output = eina_list_nth(input->dev->outputs, 0);
73
74 if (!output) return;
75
76 edev->output = output;
77
82 if (libinput_device_has_capability(edev->device, 78 if (libinput_device_has_capability(edev->device,
83 LIBINPUT_DEVICE_CAP_POINTER)) 79 LIBINPUT_DEVICE_CAP_POINTER))
84 { 80 {