diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2015-04-22 14:32:16 -0400 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2015-04-22 14:32:16 -0400 |
commit | 67460e2d78c88f525f15620ae7a583b21fc997d4 (patch) | |
tree | 51fdff66260f5d16581ec64a45432a8e2d8f8c55 /src/lib/ecore_drm/ecore_drm_evdev.c | |
parent | 0d1d62a6ab35ab22bd873dafffbf5b1469e4572e (diff) | |
download | efl-67460e2d78c88f525f15620ae7a583b21fc997d4.tar.gz |
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 'src/lib/ecore_drm/ecore_drm_evdev.c')
-rw-r--r-- | src/lib/ecore_drm/ecore_drm_evdev.c | 20 |
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) DBG("Device Has Output Name: %s", oname); EINA_LIST_FOREACH(input->dev->outputs, l, output) - { - if ((output->name) && (!strcmp(output->name, oname))) - { - edev->output = output; - break; - } - } - } - else - { - if (!(output = eina_list_nth(input->dev->outputs, 0))) return; - edev->output = output; + if ((output->name) && (!strcmp(output->name, oname))) break; } + if (!output) + output = eina_list_nth(input->dev->outputs, 0); + + if (!output) return; + + edev->output = output; + if (libinput_device_has_capability(edev->device, LIBINPUT_DEVICE_CAP_POINTER)) { |