Eina_List *l;
Eina_Bool need_assign_output = EINA_FALSE;
const char *output_name;
+ E_Output *output;
if (!(edev->caps & cap)) return;
if (edev->output_name) return; //already assigned
EINA_LIST_FOREACH(edev->seat->devices, l, ed)
{
if (!(ed->caps & cap)) continue;
- if ((ed != edev) && (ed->output_name))
+ if (ed == edev) continue;
+ if (ed->output_name)
{
need_assign_output = EINA_FALSE;
break;
}
if (need_assign_output)
{
- output_name = e_output_output_id_get(e_output_find_by_index(last_output_idx));
+ output = e_output_find_by_index(last_output_idx);
+ if (!output->info.connected) return;
+ output_name = e_output_output_id_get(output);
if (output_name) edev->output_name = eina_stringshare_add(output_name);
ELOGF("E_INPUT_EVDEV", "Device is assigned to output:%s", NULL, output_name);
}