View | Details | Raw Unified | Return to bug 116181
Collapse All | Expand All

(-)synaptics-0.14.3/synaptics.c (-12 / +10 lines)
Lines 96-102 typedef enum { Link Here
96
96
97
#define MAX(a, b) (((a)>(b))?(a):(b))
97
#define MAX(a, b) (((a)>(b))?(a):(b))
98
#define MIN(a, b) (((a)<(b))?(a):(b))
98
#define MIN(a, b) (((a)<(b))?(a):(b))
99
#define TIME_DIFF(a, b) ((long)((a)-(b)))
99
#define TIME_DIFF(a, b) ((int)((a)-(b)))
100
#define SYSCALL(call) while (((call) == -1) && (errno == EINTR))
100
#define SYSCALL(call) while (((call) == -1) && (errno == EINTR))
101
101
102
#ifndef M_PI
102
#ifndef M_PI
Lines 276-282 SynapticsPreInit(InputDriverPtr drv, IDe Link Here
276
    pointer optList;
276
    pointer optList;
277
#endif
277
#endif
278
    char *str_par;
278
    char *str_par;
279
    unsigned long now;
280
    SynapticsSHM *pars;
279
    SynapticsSHM *pars;
281
    char *repeater;
280
    char *repeater;
282
281
Lines 331-342 SynapticsPreInit(InputDriverPtr drv, IDe Link Here
331
    priv->timer = NULL;
330
    priv->timer = NULL;
332
    priv->repeatButtons = 0;
331
    priv->repeatButtons = 0;
333
    priv->nextRepeat = 0;
332
    priv->nextRepeat = 0;
334
    now = GetTimeInMillis();
335
    priv->count_packet_finger = 0;
333
    priv->count_packet_finger = 0;
336
    priv->tap_state = TS_START;
334
    priv->tap_state = TS_START;
337
    priv->tap_button = 0;
335
    priv->tap_button = 0;
338
    priv->tap_button_state = TBS_BUTTON_UP;
336
    priv->tap_button_state = TBS_BUTTON_UP;
339
    priv->touch_on.millis = now;
337
    priv->touch_on.millis = 0;
340
338
341
    /* install shared memory or normal memory for parameters */
339
    /* install shared memory or normal memory for parameters */
342
    priv->shm_config = xf86SetBoolOption(local->options, "SHMConfig", FALSE);
340
    priv->shm_config = xf86SetBoolOption(local->options, "SHMConfig", FALSE);
Lines 811-821 ReadInput(LocalDevicePtr local) Link Here
811
}
806
}
812
807
813
static int
808
static int
814
HandleMidButtonEmulation(SynapticsPrivate *priv, struct SynapticsHwState *hw, long *delay)
809
HandleMidButtonEmulation(SynapticsPrivate *priv, struct SynapticsHwState *hw, int *delay)
815
{
810
{
816
    SynapticsSHM *para = priv->synpara;
811
    SynapticsSHM *para = priv->synpara;
817
    Bool done = FALSE;
812
    Bool done = FALSE;
818
    long timeleft;
813
    int timeleft;
819
    int mid = 0;
814
    int mid = 0;
820
815
821
    while (!done) {
816
    while (!done) {
Lines 1045-1052 HandleTapProcessing(SynapticsPrivate *pr Link Here
1045
{
1040
{
1046
    SynapticsSHM *para = priv->synpara;
1041
    SynapticsSHM *para = priv->synpara;
1047
    Bool touch, release, is_timeout, move;
1042
    Bool touch, release, is_timeout, move;
1048
    long timeleft, timeout;
1043
    int timeleft, timeout;
1049
    long delay = 1000000000;
1044
    int delay = 1000000000;
1050
1045
1051
    if (priv->palm)
1046
    if (priv->palm)
1052
	return delay;
1047
	return delay;
Lines 1169-1175 estimate_delta(double x0, double x1, dou Link Here
1169
    return x0 * 0.3 + x1 * 0.1 - x2 * 0.1 - x3 * 0.3;
1164
    return x0 * 0.3 + x1 * 0.1 - x2 * 0.1 - x3 * 0.3;
1170
}
1165
}
1171
1166
1172
static long
1167
static int
1173
ComputeDeltas(SynapticsPrivate *priv, struct SynapticsHwState *hw,
1168
ComputeDeltas(SynapticsPrivate *priv, struct SynapticsHwState *hw,
1174
	      edge_type edge, int *dxP, int *dyP)
1169
	      edge_type edge, int *dxP, int *dyP)
1175
{
1170
{
Lines 1178-1184 ComputeDeltas(SynapticsPrivate *priv, st Link Here
1178
    int dist;
1173
    int dist;
1179
    double dx, dy;
1174
    double dx, dy;
1180
    double speed, integral;
1175
    double speed, integral;
1181
    long delay = 1000000000;
1176
    int delay = 1000000000;
1182
1177
1183
    dx = dy = 0;
1178
    dx = dy = 0;
1184
1179
Lines 1520-1527 HandleState(LocalDevicePtr local, struct Link Here
1520
    int change;
1516
    int change;
1521
    struct ScrollData scroll;
1517
    struct ScrollData scroll;
1522
    int double_click, repeat_delay;
1518
    int double_click, repeat_delay;
1523
    long delay = 1000000000;
1519
    int delay = 1000000000;
1524
    long timeleft;
1520
    int timeleft;
1525
    int i;
1521
    int i;
1526
1522
1527
    /* update hardware state in shared memory */
1523
    /* update hardware state in shared memory */
(-)synaptics-0.14.3/synaptics.h (-8 / +8 lines)
Lines 49-58 typedef struct _SynapticsSHM Link Here
49
    /* Parameter data */
49
    /* Parameter data */
50
    int	left_edge, right_edge, top_edge, bottom_edge; /* edge coordinates absolute */
50
    int	left_edge, right_edge, top_edge, bottom_edge; /* edge coordinates absolute */
51
    int	finger_low, finger_high;	    /* finger detection values in Z-values */
51
    int	finger_low, finger_high;	    /* finger detection values in Z-values */
52
    unsigned long tap_time;
52
    int tap_time;
53
    int tap_move;			    /* max. tapping time and movement in packets and coord. */
53
    int tap_move;			    /* max. tapping time and movement in packets and coord. */
54
    unsigned long tap_time_2;		    /* max. tapping time for double taps */
54
    int tap_time_2;			    /* max. tapping time for double taps */
55
    unsigned long click_time;		    /* The duration of a single click */
55
    int click_time;			    /* The duration of a single click */
56
    Bool fast_taps;			    /* Faster reaction to single taps */
56
    Bool fast_taps;			    /* Faster reaction to single taps */
57
    int emulate_mid_button_time;	    /* Max time between left and right button presses to
57
    int emulate_mid_button_time;	    /* Max time between left and right button presses to
58
					       emulate a middle button press. */
58
					       emulate a middle button press. */
Lines 121-127 typedef struct _SynapticsSHM Link Here
121
typedef struct _SynapticsMoveHist
121
typedef struct _SynapticsMoveHist
122
{
122
{
123
    int x, y;
123
    int x, y;
124
    unsigned int millis;
124
    int millis;
125
} SynapticsMoveHistRec;
125
} SynapticsMoveHistRec;
126
126
127
enum MidButtonEmulation {
127
enum MidButtonEmulation {
Lines 177-185 typedef struct _SynapticsPrivateRec Link Here
177
    int scroll_y;			/* last y-scroll position */
177
    int scroll_y;			/* last y-scroll position */
178
    int scroll_x;			/* last x-scroll position */
178
    int scroll_x;			/* last x-scroll position */
179
    double scroll_a;			/* last angle-scroll position */
179
    double scroll_a;			/* last angle-scroll position */
180
    unsigned long count_packet_finger;	/* packet counter with finger on the touchpad */
180
    int count_packet_finger;		/* packet counter with finger on the touchpad */
181
    unsigned int button_delay_millis;	/* button delay for 3rd button emulation */
181
    int button_delay_millis;		/* button delay for 3rd button emulation */
182
    unsigned int prev_up;		/* Previous up button value, for double click emulation */
182
    Bool prev_up;			/* Previous up button value, for double click emulation */
183
    Bool finger_flag;			/* previous finger */
183
    Bool finger_flag;			/* previous finger */
184
184
185
    enum TapState tap_state;		/* State of tap processing */
185
    enum TapState tap_state;		/* State of tap processing */
Lines 201-207 typedef struct _SynapticsPrivateRec Link Here
201
    double frac_x, frac_y;		/* absolute -> relative fraction */
203
    double frac_x, frac_y;		/* absolute -> relative fraction */
202
    enum MidButtonEmulation mid_emu_state;	/* emulated 3rd button */
204
    enum MidButtonEmulation mid_emu_state;	/* emulated 3rd button */
203
    int repeatButtons;			/* buttons for repeat */
205
    int repeatButtons;			/* buttons for repeat */
204
    unsigned long nextRepeat;		/* Time when to trigger next auto repeat event */
206
    int nextRepeat;			/* Time when to trigger next auto repeat event */
205
    int lastButtons;			/* last state of the buttons */
207
    int lastButtons;			/* last state of the buttons */
206
    int palm;				/* Set to true when palm detected, reset to false when
208
    int palm;				/* Set to true when palm detected, reset to false when
207
					   palm/finger contact disappears */
209
					   palm/finger contact disappears */

Return to bug 116181