summaryrefslogtreecommitdiff
path: root/src/emuMB.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-10-08 14:25:53 +1030
committerPeter Hutterer <peter.hutterer@redhat.com>2008-10-11 12:24:54 +1030
commit6f6ac982951165a6ac77b3e32750c47780ea4990 (patch)
tree8a3e4c671ccf9c85da6e4016c0506d578801a1ef /src/emuMB.c
parenta2633c807812e6e8ad9c82e2a5940dfbf370aff5 (diff)
Add checkonly handling to property handlers.
If checkonly is TRUE, we can only check if applying the value would succeed. The value is actually applied if checkonly is FALSE.
Diffstat (limited to 'src/emuMB.c')
-rw-r--r--src/emuMB.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/emuMB.c b/src/emuMB.c
index 5de5227..472e74f 100644
--- a/src/emuMB.c
+++ b/src/emuMB.c
@@ -385,7 +385,8 @@ EvdevMBEmuInitProperty(DeviceIntPtr dev)
}
int
-EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val)
+EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
+ BOOL checkonly)
{
InputInfoPtr pInfo = dev->public.devicePrivate;
EvdevPtr pEvdev = pInfo->private;
@@ -395,13 +396,15 @@ EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val)
if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
return BadMatch;
- pEvdev->emulateMB.enabled = *((BOOL*)val->data);
+ if (!checkonly)
+ pEvdev->emulateMB.enabled = *((BOOL*)val->data);
} else if (atom == prop_mbtimeout)
{
if (val->format != 16 || val->size != 1 || val->type != XA_INTEGER)
return BadMatch;
- pEvdev->emulateMB.timeout = *((INT16*)val->data);
+ if (!checkonly)
+ pEvdev->emulateMB.timeout = *((INT16*)val->data);
}
return Success;