aboutsummaryrefslogtreecommitdiff
path: root/src/emuMB.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emuMB.c')
-rw-r--r--src/emuMB.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/emuMB.c b/src/emuMB.c
index 8e8e2ac..ab6dae9 100644
--- a/src/emuMB.c
+++ b/src/emuMB.c
@@ -342,6 +342,32 @@ EvdevMBEmuEnable(InputInfoPtr pInfo, BOOL enable)
#ifdef HAVE_PROPERTIES
+int
+EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
+ BOOL checkonly)
+{
+ InputInfoPtr pInfo = dev->public.devicePrivate;
+ EvdevPtr pEvdev = pInfo->private;
+
+ if (atom == prop_mbemu)
+ {
+ if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
+ return BadMatch;
+
+ 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;
+
+ if (!checkonly)
+ pEvdev->emulateMB.timeout = *((INT16*)val->data);
+ }
+
+ return Success;
+}
+
/**
* Initialise property for MB emulation on/off.
*/
@@ -376,30 +402,4 @@ EvdevMBEmuInitProperty(DeviceIntPtr dev)
XIRegisterPropertyHandler(dev, EvdevMBEmuSetProperty, NULL, NULL);
}
-
-int
-EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
- BOOL checkonly)
-{
- InputInfoPtr pInfo = dev->public.devicePrivate;
- EvdevPtr pEvdev = pInfo->private;
-
- if (atom == prop_mbemu)
- {
- if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
- return BadMatch;
-
- 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;
-
- if (!checkonly)
- pEvdev->emulateMB.timeout = *((INT16*)val->data);
- }
-
- return Success;
-}
#endif