Hi Pierre. Thank you for taking the time to create a patch.
My biggest change was moving the following up in the HandleState function, so the low level state is corrected *before* doing button detection (this removed the quirk that depended on the order in which fingers hit the touchpad):
//Correct HW state by throwing out fingers outside of the active area
inside_active_area = FALSE;
hw->numFingers = 0;
for (int i = 0; i < hw->num_mt_mask; i++) { ValuatorMask *f1;
Bool mt_inside;
double x1, y1;
if (hw->slot_state[i] == SLOTSTATE_EMPTY || hw->slot_state[i] == SLOTSTATE_CLOSE) continue;
You may notice that I removed the check to see if the touchpad is a clickpad - I did this because it did not look like the code was being executed. You could put that back in (turned out I was not actually replacing the installed driver when I did "make install").
Secondly, I also removed something odd from is_inside_active_area. That function now looks like:
static Bool is_inside_active_area(SynapticsPrivate * priv, int x, int y) {
if ((priv->synpara.area_left_edge != 0) && (x < priv->synpara.area_left_edge))
return FALSE;
else if ((priv->synpara.area_right_edge != 0) && (x > priv->synpara.area_right_edge))
return FALSE;
I did this mainly because the code that was there was not consistent with how the function is being used now - it would return true in circumstances when the source finger was NOT in the active area but if something else was (which could mess up the finger count). I don't think I tried the first change without the second, but it is certainly plausible that the second change could fix the type of behavior you are talking about. I have not seen such behavior on my machine with these changes.
It seems suspicious that the patched driver would result in no changes. I would make sure that you are actually running your custom version of the driver and not the stock version. Try to break something deliberately - I would suggest putting:
if (hw->numFingers > 1) hw->numFingers = 1;
After the first change and try to run the new driver. If two-finger scroll still works you know that you are running the old driver.
Hi Pierre. Thank you for taking the time to create a patch.
My biggest change was moving the following up in the HandleState function, so the low level state is corrected *before* doing button detection (this removed the quirk that depended on the order in which fingers hit the touchpad):
//Correct HW state by throwing out fingers outside of the active area active_ area = FALSE;
ValuatorMask *f1;
inside_
hw->numFingers = 0;
for (int i = 0; i < hw->num_mt_mask; i++) {
Bool mt_inside;
double x1, y1;
if (hw->slot_state[i] == SLOTSTATE_EMPTY || hw->slot_state[i] == SLOTSTATE_CLOSE)
continue;
f1 = hw->mt_mask[i]; mask_get_ double( f1, 0); mask_get_ double( f1, 1); active_ area(priv, x1, y1);
hw- >slot_state[ i] = SLOTSTATE_EMPTY;
continue; active_ area) {
inside_ active_ area = TRUE;
hw->numFingers ++;
x1 = valuator_
y1 = valuator_
mt_inside = is_inside_
if (!mt_inside) {
}
if (!inside_
hw->x = x1;
hw->y = y1;
}
}
You may notice that I removed the check to see if the touchpad is a clickpad - I did this because it did not look like the code was being executed. You could put that back in (turned out I was not actually replacing the installed driver when I did "make install").
Secondly, I also removed something odd from is_inside_ active_ area. That function now looks like:
static Bool is_inside_ active_ area(SynapticsP rivate * priv, int x, int y) { >synpara. area_left_ edge != 0) && (x < priv->synpara. area_left_ edge)) >synpara. area_right_ edge != 0) && (x > priv->synpara. area_right_ edge))
if ((priv-
return FALSE;
else if ((priv-
return FALSE;
if ((priv- >synpara. area_top_ edge != 0) && (y < priv->synpara. area_top_ edge)) >synpara. area_bottom_ edge != 0) && (y > priv->synpara. area_bottom_ edge))
return FALSE;
else if ((priv-
return FALSE;
return TRUE;
}
I did this mainly because the code that was there was not consistent with how the function is being used now - it would return true in circumstances when the source finger was NOT in the active area but if something else was (which could mess up the finger count). I don't think I tried the first change without the second, but it is certainly plausible that the second change could fix the type of behavior you are talking about. I have not seen such behavior on my machine with these changes.
It seems suspicious that the patched driver would result in no changes. I would make sure that you are actually running your custom version of the driver and not the stock version. Try to break something deliberately - I would suggest putting:
if (hw->numFingers > 1) hw->numFingers = 1;
After the first change and try to run the new driver. If two-finger scroll still works you know that you are running the old driver.
Bryan