summarylogtreecommitdiffstats
path: root/14393-gestures-only.patch
blob: 7b2e35230d255d0b1d1f487bb80a0d4a2bd40108 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
diff --git a/include/synaptics-properties.h b/include/synaptics-properties.h
index b717880..22a12cd 100644
--- a/include/synaptics-properties.h
+++ b/include/synaptics-properties.h
@@ -152,4 +152,7 @@
 /* 32 Bit Integer, 2 values, horizontal hysteresis, vertical hysteresis */
 #define SYNAPTICS_PROP_NOISE_CANCELLATION "Synaptics Noise Cancellation"
 
+/* 8 bit (BOOL) */
+#define SYNAPTICS_PROP_GESTURES_ONLY "Synaptics Gestures Only"
+
 #endif                          /* _SYNAPTICS_PROPERTIES_H_ */
diff --git a/man/synaptics.man b/man/synaptics.man
index 079a5f8..836bf69 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -447,6 +447,14 @@ soft button areas. Button areas may not overlap, however it is permitted for two
 buttons to share an edge value.
 Property: "Synaptics Soft Button Areas"
 .
+.TP
+.BI "Option \*qGesturesOnly\*q \*q" boolean \*q
+Disable pointer motion events.
+
+The option is disabled by default. If set, the driver will report gesture and
+button events but no pointer events.
+Property: "Synaptics Gestures Only"
+.
 
 .SH CONFIGURATION DETAILS
 .SS Area handling
@@ -822,6 +830,10 @@ disables the button area.
 32 bit, 8 values, RBL, RBR, RBT, RBB, MBL, MBR, MBT, MBB.
 
 .TP 7
+.BI "Synaptics Gestures Only"
+8 bit (BOOL).
+
+.TP 7
 .BI "Synaptics Capabilities"
 This read-only property expresses the physical capability of the touchpad,
 most notably whether the touchpad hardware supports multi-finger tapping and
@@ -833,7 +845,6 @@ right button, two-finger detection, three-finger detection, pressure detection,
 .TP 7
 .BI "Synaptics Pad Resolution"
 32 bit unsigned, 2 values (read-only), vertical, horizontal in units/millimeter.
-
 .SH "NOTES"
 Configuration through
 .I InputClass
diff --git a/src/properties.c b/src/properties.c
index dd88fc7..6e838ff 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -91,6 +91,7 @@ Atom prop_softbutton_areas = 0;
 Atom prop_noise_cancellation = 0;
 Atom prop_product_id = 0;
 Atom prop_device_node = 0;
+Atom prop_gestures_only = 0;
 
 static Atom
 InitTypedAtom(DeviceIntPtr dev, char *name, Atom type, int format, int nvalues,
@@ -341,6 +342,10 @@ InitDeviceProperties(InputInfoPtr pInfo)
                                        SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 2,
                                        values);
 
+    prop_gestures_only =
+        InitAtom(pInfo->dev, SYNAPTICS_PROP_GESTURES_ONLY, 8, 1,
+		 &para->gestures_only);
+
     /* only init product_id property if we actually know them */
     if (priv->id_vendor || priv->id_product) {
         values[0] = priv->id_vendor;
@@ -705,6 +710,12 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
         para->hyst_x = hyst[0];
         para->hyst_y = hyst[1];
     }
+    else if (property == prop_gestures_only) {
+        if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
+            return BadMatch;
+
+        para->gestures_only = *(BOOL *) prop->data;
+    }
     else if (property == prop_product_id || property == prop_device_node)
         return BadValue;        /* read-only */
     else { /* unknown property */
diff --git a/src/synaptics.c b/src/synaptics.c
index e391a98..8302cbb 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -646,7 +646,10 @@ set_default_parameters(InputInfoPtr pInfo)
     pars->tap_move = xf86SetIntOption(opts, "MaxTapMove", tapMove);
     pars->tap_time_2 = xf86SetIntOption(opts, "MaxDoubleTapTime", 180);
     pars->click_time = xf86SetIntOption(opts, "ClickTime", 100);
-    pars->clickpad = xf86SetBoolOption(opts, "ClickPad", pars->clickpad);       /* Probed */
+    pars->gestures_only = xf86SetBoolOption(opts, "GesturesOnly",
+					    pars->gestures_only);
+    pars->clickpad = xf86SetBoolOption(opts, "ClickPad", pars->clickpad);
+ /* Probed */
     /* middle mouse button emulation on a clickpad? nah, you're joking */
     middle_button_timeout = pars->clickpad ? 0 : 75;
     pars->emulate_mid_button_time =
@@ -2901,7 +2904,7 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
     }
 
     /* Post events */
-    if (finger >= FS_TOUCHED && (dx || dy))
+    if (finger >= FS_TOUCHED && (dx || dy) && !para->gestures_only)
         xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy);
 
     if (priv->mid_emu_state == MBE_LEFT_CLICK) {
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index a9901a2..6678d34 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -196,6 +196,7 @@ typedef struct _SynapticsParameters {
     int area_left_edge, area_right_edge, area_top_edge, area_bottom_edge;       /* area coordinates absolute */
     int softbutton_areas[2][4]; /* soft button area coordinates, 0 => right, 1 => middle button */
     int hyst_x, hyst_y;         /* x and y width of hysteresis box */
+    Bool gestures_only;		/* do not post mouse input events */
 } SynapticsParameters;
 
 struct _SynapticsPrivateRec {