summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-07-07 14:34:47 -0400
committerChris Michael <cp.michael@samsung.com>2016-07-08 08:05:20 -0400
commit5a482e9af46376ae9b7edce0629a3123fa0692c1 (patch)
tree265911aba171fa6fef870b781570c6d6683dd68f /src/lib
parente0cde404757e3c6775f5d8ffb14353e56e6b2a81 (diff)
ecore-drm2: Perform input device calibration based on output name
When a new input device gets added, device calibration may need to be performed. In order for that to be done properly, we need to know which output this input device is associated with. This patch makes a function call to Elput in order to retrieve that output name and perform the proper calibration. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index 831c53837b..8794063a2a 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -41,12 +41,33 @@ _cb_device_change(void *data, int type EINA_UNUSED, void *event)
41 41
42 if (ev->type == ELPUT_DEVICE_ADDED) 42 if (ev->type == ELPUT_DEVICE_ADDED)
43 { 43 {
44 Eina_List *l;
44 Ecore_Drm2_Output *output; 45 Ecore_Drm2_Output *output;
46 Eina_Stringshare *name;
45 47
46 /* FIXME: not sure which output to use to calibrate */ 48 name = elput_input_device_output_name_get(ev->device);
47 output = eina_list_data_get(device->outputs); 49 if (!name)
48 if (output) 50 {
49 ecore_drm2_device_calibrate(device, output->w, output->h); 51 output = eina_list_data_get(device->outputs);
52 if (output)
53 ecore_drm2_device_calibrate(device,
54 output->w, output->h);
55 }
56 else
57 {
58 EINA_LIST_FOREACH(device->outputs, l, output)
59 {
60 if ((output->name) &&
61 (!strcmp(output->name, name)))
62 {
63 ecore_drm2_device_calibrate(device,
64 output->w, output->h);
65 break;
66 }
67 }
68
69 eina_stringshare_del(name);
70 }
50 } 71 }
51 72
52 return ECORE_CALLBACK_RENEW; 73 return ECORE_CALLBACK_RENEW;