static Eina_Bool
_e_devicemgr_init_touch_coords_and_axis(E_Devicemgr_Inputgen_Device_Data *device)
{
+ int touch_max = e_input_touch_max_count_get();
+ int i;
if (device->touch.coords)
free(device->touch.coords);
- device->touch.coords = calloc(1, sizeof(E_Devicemgr_Coords)*e_input_touch_max_count_get());
+ if (e_config->configured_max_touch.use)
+ {
+ touch_max = e_config->configured_max_touch.count;
+ }
+ device->touch.coords = calloc(1, sizeof(E_Devicemgr_Coords)*touch_max);
if (!device->touch.coords)
{
- DMWRN("Failed to allocate memory for coords ptr ! (finger=%d)\n", e_input_touch_max_count_get());
+ DMWRN("Failed to allocate memory for coords ptr ! (finger=%d)\n", touch_max);
return EINA_FALSE;
}
+ for (i = 0; i < touch_max; i++)
+ {
+ device->touch.coords[i].x = -1;
+ device->touch.coords[i].y = -1;
+ }
+
if (device->touch.axis)
free(device->touch.axis);
- device->touch.axis = calloc(1, sizeof(E_Devicemgr_Inputgen_Touch_Axis)*e_input_touch_max_count_get());
+ device->touch.axis = calloc(1, sizeof(E_Devicemgr_Inputgen_Touch_Axis)*touch_max);
if (!device->touch.axis)
{
- DMWRN("Failed to allocate memory for axis ptr ! (finger=%d)\n", e_input_touch_max_count_get());
+ DMWRN("Failed to allocate memory for axis ptr ! (finger=%d)\n", touch_max);
free(device->touch.coords);
return EINA_FALSE;
}
goto fail_create_device;
}
- for (i = 0; i < e_input_touch_max_count_get(); i++)
- {
- device->touch.coords[i].x = -1;
- device->touch.coords[i].y = -1;
- }
-
return TIZEN_INPUT_DEVICE_MANAGER_ERROR_NONE;
fail_create_device:
uinp.absmin[ABS_Y] = 0;
uinp.absmax[ABS_Y] = 1000;
uinp.absmin[ABS_MT_SLOT] = 0;
- uinp.absmax[ABS_MT_SLOT] = e_input_touch_max_count_get() - 1;
+ if (e_config->configured_max_touch.use)
+ uinp.absmax[ABS_MT_SLOT] = e_config->configured_max_touch.count - 1;
+ else
+ uinp.absmax[ABS_MT_SLOT] = e_input_touch_max_count_get() - 1;
uinp.absmin[ABS_MT_TOUCH_MAJOR] = 0;
uinp.absmax[ABS_MT_TOUCH_MAJOR] = 255;
uinp.absmin[ABS_MT_TOUCH_MINOR] = 0;