static void _device_configured_size_get(E_Input_Evdev *edev, int *x, int *y, int *w, int *h);
static void _device_output_assign(E_Input_Evdev *edev, E_Input_Seat_Capabilities cap);
+static Eina_Bool _touch_blocked_by_palm, _touch_up_blocked_by_palm;
+
void
_device_calibration_set(E_Input_Evdev *edev)
{
atomic_fetch_or(&edev->touch.raw_pressed, (1 << edev->mt_slot));
+ if (_touch_blocked_by_palm)
+ {
+ ELOGF("Touch", "Down (id: %d, x: %d, y: %d) is blocked during palm", NULL,
+ edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+ return;
+ }
+
if (edev->touch.blocked)
{
void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
edev->touch.coords[edev->mt_slot].y = edev->seat->ptr.iy;
}
+ if (_touch_blocked_by_palm)
+ {
+ ELOGF("Touch", "Move (id: %d, x: %d, y: %d) is blocked during palm", NULL,
+ edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+ return;
+ }
+
if (!(edev->touch.pressed & (1 << edev->mt_slot)))
{
if (edev->touch.blocked)
atomic_fetch_and(&edev->touch.raw_pressed, ~(1 << edev->mt_slot));
+ if (_touch_blocked_by_palm)
+ {
+ ELOGF("Touch", "Up (id: %d, x: %d, y: %d) is blocked during palm", NULL,
+ edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+
+ return;
+ }
+ else if (_touch_up_blocked_by_palm)
+ {
+ ELOGF("Touch", "Up (id: %d, x: %d, y: %d) is blocked lastly on palm up.", NULL,
+ edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+
+ _touch_up_blocked_by_palm = EINA_FALSE;
+
+ return;
+ }
+
if (edev->touch.blocked)
{
if (!(edev->touch.pressed & (1 << edev->mt_slot)))
Ecore_Device *ecore_dev = NULL, *data;
Eina_List *l;
E_Comp_Config *comp_conf;
+ int touch_value;
ecore_thread_main_loop_begin();
if (!(edev = libinput_device_get_user_data(device))) goto end;
if (!(input = edev->seat->input)) goto end;
+ touch_value = libinput_event_touch_aux_data_get_value(event);
+
if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
{
if (axis)
{
axis->label = ECORE_AXIS_LABEL_TOUCH_PALM;
- axis->value = libinput_event_touch_aux_data_get_value(event);
+ axis->value = touch_value;
ev->naxis = 1;
}
ev->axis = axis;
if (comp_conf && comp_conf->input_log_enable)
ELOGF("Touch", "Axis (label: %d, value: %lf)", NULL, axis?axis->label:-1, axis?axis->value:0.0);
+ if (comp_conf && comp_conf->touch_block_on_palm == 1)
+ {
+ if (touch_value > 0)
+ {
+ _touch_blocked_by_palm = EINA_TRUE;
+ _touch_up_blocked_by_palm = EINA_TRUE;
+ }
+ else
+ {
+ _touch_blocked_by_palm = EINA_FALSE;
+ }
+ }
+
ev->dev = ecore_device_ref(ecore_dev);
ecore_event_add(ECORE_EVENT_AXIS_UPDATE, ev, _e_input_aux_data_event_free, NULL);