summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
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;