diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2008-10-13 13:56:49 +1030 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-13 15:03:57 +1030 |
commit | 149be75873b39e64afc5959b41360396b86fd880 (patch) | |
tree | e913ec9482750b61cbff7a2c9d01771548735bbc /src/properties.c | |
parent | db6e631d31d4ffd476ccd105f8adb8d8b4727b29 (diff) |
properties: handle checkonly flag.
if checkonly is TRUE, only check the values but do not apply them. This is
achieved by working on a temporary copy of the parameters if checkonly is set,
and ditching the copy after completion.
If checkout is not set, the same code works on the actual parameters.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Diffstat (limited to 'src/properties.c')
-rw-r--r-- | src/properties.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/properties.c b/src/properties.c index aa197f2..ea348cc 100644 --- a/src/properties.c +++ b/src/properties.c @@ -208,11 +208,21 @@ InitDeviceProperties(LocalDevicePtr local) } int -SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop) +SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, + BOOL checkonly) { LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate; SynapticsPrivate *priv = (SynapticsPrivate *) local->private; SynapticsSHM *para = priv->synpara; + SynapticsSHM tmp; + + /* If checkonly is set, no parameters may be changed. So just let the code + * change temporary variables and forget about it. */ + if (checkonly) + { + tmp = *para; + para = &tmp; + } if (property == prop_edges) { |