summaryrefslogtreecommitdiff
path: root/src/properties.c
diff options
context:
space:
mode:
authorAapo Rantalainen <aapo.rantalainen@gmail.com>2011-03-09 21:32:36 +0100
committerChristoph Brill <egore911@egore911.de>2011-03-09 22:27:04 +0100
commit049d5fb6037b34d94b24cb8300849cf4e3b67437 (patch)
treeb93bdd5fe6e57131309050dca1ae6c83e92cb84c /src/properties.c
parentd6fc5be2969b9eede3c0fdd6e03daec4100a8c9f (diff)
Add synaptics orientation support
This patch allows usage of "synclient Orientation=0" (values from 0 to 3). It will rotate the touchpad similar to "xrandr -o". Original patch was extended for alps and ps2. Signed-off-by: Christoph Brill <egore911@egore911.de>
Diffstat (limited to 'src/properties.c')
-rw-r--r--src/properties.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/properties.c b/src/properties.c
index 23b5a6a..06909ed 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -83,6 +83,7 @@ Atom prop_capabilities = 0;
Atom prop_resolution = 0;
Atom prop_area = 0;
Atom prop_noise_cancellation = 0;
+Atom prop_orientation = 0;
static Atom
InitAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values)
@@ -285,6 +286,8 @@ InitDeviceProperties(InputInfoPtr pInfo)
prop_noise_cancellation = InitAtom(pInfo->dev,
SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 2, values);
+ prop_orientation = InitAtom(pInfo->dev, SYNAPTICS_ORIENTATION, 32, 1, &para->orientation);
+
}
int
@@ -666,6 +669,11 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
return BadValue;
para->hyst_x = hyst[0];
para->hyst_y = hyst[1];
+ } else if (property == prop_orientation)
+ {
+ if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER)
+ return BadMatch;
+ para->orientation = *(INT32*)prop->data;
}
return Success;