forked from enlightenment/efl
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>
This commit is contained in:
parent
e0cde40475
commit
5a482e9af4
|
@ -41,12 +41,33 @@ _cb_device_change(void *data, int type EINA_UNUSED, void *event)
|
|||
|
||||
if (ev->type == ELPUT_DEVICE_ADDED)
|
||||
{
|
||||
Eina_List *l;
|
||||
Ecore_Drm2_Output *output;
|
||||
Eina_Stringshare *name;
|
||||
|
||||
/* FIXME: not sure which output to use to calibrate */
|
||||
output = eina_list_data_get(device->outputs);
|
||||
if (output)
|
||||
ecore_drm2_device_calibrate(device, output->w, output->h);
|
||||
name = elput_input_device_output_name_get(ev->device);
|
||||
if (!name)
|
||||
{
|
||||
output = eina_list_data_get(device->outputs);
|
||||
if (output)
|
||||
ecore_drm2_device_calibrate(device,
|
||||
output->w, output->h);
|
||||
}
|
||||
else
|
||||
{
|
||||
EINA_LIST_FOREACH(device->outputs, l, output)
|
||||
{
|
||||
if ((output->name) &&
|
||||
(!strcmp(output->name, name)))
|
||||
{
|
||||
ecore_drm2_device_calibrate(device,
|
||||
output->w, output->h);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
eina_stringshare_del(name);
|
||||
}
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
|
|
Loading…
Reference in New Issue