Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 36790 - gpm synps2 4-way-button does not work when four_way_button_is_mouse is FALSE in /etc/gpm/gpm-syn.conf
Summary: gpm synps2 4-way-button does not work when four_way_button_is_mouse is FALSE ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-30 01:43 UTC by Pavel Semerad
Modified: 2005-02-12 20:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
second version of patch - correct handling of 4button+move (gpm-4waybutton,1.59 KB, patch)
2004-01-02 03:01 UTC, Pavel Semerad
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Semerad 2003-12-30 01:43:49 UTC
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;
 }
Comment 1 Pavel Semerad 2004-01-02 03:01:09 UTC
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.
Comment 2 Michael M Nazaroff (RETIRED) gentoo-dev 2004-01-12 00:16:59 UTC
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
Comment 3 SpanKY gentoo-dev 2004-10-03 00:16:33 UTC
have you tried sending this upstream ?
Comment 4 Michael M Nazaroff (RETIRED) gentoo-dev 2004-10-03 11:01:37 UTC
No I haven't, but thats a good idea :-)
Comment 5 SpanKY gentoo-dev 2004-10-03 11:05:48 UTC
i glanced at the patch and it looks pretty sane, but it'd be better if upstream took it, that way everyone wins :)
Comment 6 SpanKY gentoo-dev 2005-02-12 20:52:34 UTC
added to gpm-1.20.1-r4, thanks