summaryrefslogtreecommitdiff
path: root/src/wcmCommon.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2021-11-26 13:44:50 +1000
committerPing Cheng <pinglinux@gmail.com>2021-11-29 21:42:20 -0800
commit8f16e564ca57dff5365f7ba82e3890adeaa5377a (patch)
treeb144a09e27b26dadae8c9bdd29b1693a2733d58d /src/wcmCommon.c
parent32a712f67a3a84c957e77d5e76c543ef7f8fdde2 (diff)
downloadxf86-input-wacom-8f16e564ca57dff5365f7ba82e3890adeaa5377a.tar.gz
Hide the WACOM_DRIVER struct a bit better
There's only one call outside wcmCommon and that just resets the pointer - let's make this struct static and provide a function to reset it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/wcmCommon.c')
-rw-r--r--src/wcmCommon.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 11bc5ca..a78e74e 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -27,10 +27,18 @@
#include <xf86_OSproc.h>
-struct _WacomDriverRec WACOM_DRIVER = {
+static struct _WacomDriverRec
+{
+ WacomDevicePtr active; /* Arbitrate motion through this pointer */
+} WACOM_DRIVER = {
.active = NULL,
};
+void wcmRemoveActive(WacomDevicePtr priv)
+{
+ if (WACOM_DRIVER.active == priv)
+ WACOM_DRIVER.active = NULL;
+}
/*****************************************************************************
* Static functions