I found there are errors in synaptics.c source file. One is overwriting memory (other variables) and second is assign of synaptics internal numbers to state->buttons (struct Gpm_Event). Reproducible: Always Steps to Reproduce: 0. set four_way_button_is_mouse to FALSE in /etc/gpm/gpm-syn.cnf 1. run "gpm -t synps2 -D" on synaptics touchpad with 4-way-button (or stick) 2. press 4-way-button 3. press left (not 4way) button Actual Results: 3: You will see bad button number because last_4_way_buttons is left set to something and then gets assigned to state->buttons in every next processing. And next Left/Right buttons does not work anymore, because is_tossing and was_tossing were overwriten to -1. Expected Results: Button numbers assigned to buttons This patch solves it. Array boundaries must be set to 8, because of for cycle in tp_process_repeating_actions(). And assign of last_4_way_buttons cannot be done to state->buttons. I have commented it out (and it seems to work), but may be this is not the correct solution. --- ./src/synaptics.c.ps 2002-12-24 23:57:16.000000000 +0100 +++ ./src/synaptics.c 2003-12-30 10:31:34.000000000 +0100 @@ -830,9 +830,9 @@ static int last_corner_action static int last_finger_action = GPM_B_NOT_SET; static int last_normal_button_actions[6] = {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[3] = +static int last_stick_button_actions[8] = {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[4] = +static int last_4_way_button_actions[8] = {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; /* toss status information */ @@ -1483,7 +1483,7 @@ static int syn_ps2_process_extended_pack } /* Multiplexing with the stick (guest) device. */ - state->buttons |= last_4_way_buttons | last_stick_buttons; + /* state->buttons |= last_4_way_buttons | last_stick_buttons; */ return 0; }
Created attachment 23004 [details, diff] second version of patch - correct handling of 4button+move I have added correct (I hope) handling of 4_way_button together with moving finger on touchpad. Code is executing if it is not extended packet. If there is some pressure (Z), last state of buttons is set (by calling process_repeating_actions, not by assign). And if pressure is 0 (this is also send while tapping touchpad and releasing 4_way_button), then last state is set to GPM_B_NONE and button is correctly released.
I verified the patch applies, can some other people test this out some how? That would be fantastic to verify it on couple of machines instead of just one persons. Has anyone else but me looked at this? Michael Nazaroff
have you tried sending this upstream ?
No I haven't, but thats a good idea :-)
i glanced at the patch and it looks pretty sane, but it'd be better if upstream took it, that way everyone wins :)
added to gpm-1.20.1-r4, thanks