summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-05-31 17:52:42 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2016-06-02 09:42:05 +1000
commit7b1267f7f18c478d3dc34a7668eaefa402815891 (patch)
tree78ccfd20e5261bf80e5e50c7543f59df2fa9a23d
parente08b0332761b0cff6d6a3f5d7e88c22f786bd530 (diff)
Support XINPUT ABI version 23 (threaded input)
Use input_lock/input_unlock calls instead of SIGIO functions Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/emuMB.c13
-rw-r--r--src/emuThird.c13
-rw-r--r--src/evdev.h4
3 files changed, 24 insertions, 6 deletions
diff --git a/src/emuMB.c b/src/emuMB.c
index b25eac8..94e50c4 100644
--- a/src/emuMB.c
+++ b/src/emuMB.c
@@ -184,10 +184,13 @@ int
EvdevMBEmuTimer(InputInfoPtr pInfo)
{
EvdevPtr pEvdev = pInfo->private;
- int sigstate;
int id;
- sigstate = xf86BlockSIGIO ();
+#if HAVE_THREADED_INPUT
+ input_lock();
+#else
+ int sigstate = xf86BlockSIGIO();
+#endif
pEvdev->emulateMB.pending = FALSE;
if ((id = stateTab[pEvdev->emulateMB.state][4][0]) != 0) {
@@ -200,7 +203,11 @@ EvdevMBEmuTimer(InputInfoPtr pInfo)
pEvdev->emulateMB.state);
}
- xf86UnblockSIGIO (sigstate);
+#if HAVE_THREADED_INPUT
+ input_unlock();
+#else
+ xf86UnblockSIGIO(sigstate);
+#endif
return 0;
}
diff --git a/src/emuThird.c b/src/emuThird.c
index 5f14d33..dd49a84 100644
--- a/src/emuThird.c
+++ b/src/emuThird.c
@@ -89,12 +89,19 @@ Evdev3BEmuTimer(OsTimerPtr timer, CARD32 time, pointer arg)
InputInfoPtr pInfo = (InputInfoPtr)arg;
EvdevPtr pEvdev = pInfo->private;
struct emulate3B *emu3B = &pEvdev->emulate3B;
- int sigstate = 0;
- sigstate = xf86BlockSIGIO ();
+#if HAVE_THREADED_INPUT
+ input_lock();
+#else
+ int sigstate = xf86BlockSIGIO();
+#endif
emu3B->state = EM3B_EMULATING;
Evdev3BEmuPostButtonEvent(pInfo, emu3B->button, BUTTON_PRESS);
- xf86UnblockSIGIO (sigstate);
+#if HAVE_THREADED_INPUT
+ input_unlock();
+#else
+ xf86UnblockSIGIO(sigstate);
+#endif
return 0;
}
diff --git a/src/evdev.h b/src/evdev.h
index 4d44d2b..0ebcfa0 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -67,6 +67,10 @@
#define LogMessageVerbSigSafe xf86MsgVerb
#endif
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23
+#define HAVE_THREADED_INPUT 1
+#endif
+
#define EVDEV_MAXBUTTONS 32
#define EVDEV_MAXQUEUE 32