{
E_Devicemgr_Input_Device *dev;
Eina_List *l;
+ int current_touch_count = -1;
EINA_LIST_FOREACH(e_devicemgr->device_list, l, dev)
{
if (dev->clas == ECORE_DEVICE_CLASS_MOUSE)
e_devicemgr->last_device_ptr = dev;
- if (!e_devicemgr->last_device_touch && dev->clas == ECORE_DEVICE_CLASS_TOUCH)
+ if (dev->clas == ECORE_DEVICE_CLASS_TOUCH)
{
- e_devicemgr->last_device_touch = dev;
+ if (!e_devicemgr->last_device_touch)
+ e_devicemgr->last_device_touch = dev;
- if (e_devicemgr->multi)
+ current_touch_count = e_input_touch_max_count_get();
+ if (e_devicemgr->max_touch_count < current_touch_count)
{
- ELOGF("DEVMGR_TOUCH", "Multi pointer is NOT NULL. It'll be updated.\n", NULL);
- free (e_devicemgr->multi);
- }
+ e_devicemgr->max_touch_count = current_touch_count;
+ if (e_devicemgr->multi)
+ {
+ ELOGF("DEVMGR_TOUCH", "Multi pointer is NOT NULL. It'll be updated to %d finger of touch.\n", NULL, current_touch_count);
+ free (e_devicemgr->multi);
+ }
- e_devicemgr->multi = calloc(1, sizeof(E_Devicemgr_Input_Device_Multi)*e_input_touch_max_count_get());
+ e_devicemgr->multi = calloc(1, sizeof(E_Devicemgr_Input_Device_Multi)*current_touch_count);
- if (!e_devicemgr->multi)
- ELOGF("DEVMGR_TOUCH", "Failed to allocate memory for multi ptr. (finger=%d)\n", NULL, e_input_touch_max_count_get());
+ if (!e_devicemgr->multi)
+ ELOGF("DEVMGR_TOUCH", "Failed to allocate memory for multi ptr. (finger=%d)\n", NULL, current_touch_count);
+ }
}
if (!e_devicemgr->last_device_kbd && dev->clas == ECORE_DEVICE_CLASS_KEYBOARD)
DMWRN("input.virtual_mouse_device_enable: but failed to create device !\n");
}
+ e_devicemgr->max_touch_count = 0;
+
return EINA_TRUE;
}