diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-08 14:25:53 +1030 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-11 12:24:54 +1030 |
commit | 6f6ac982951165a6ac77b3e32750c47780ea4990 (patch) | |
tree | 8a3e4c671ccf9c85da6e4016c0506d578801a1ef /src/emuMB.c | |
parent | a2633c807812e6e8ad9c82e2a5940dfbf370aff5 (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.c | 9 |
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; |