summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2021-11-25 20:27:07 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2021-12-20 15:01:56 +1000
commit790211e8fb02e309cd71428d46aa175badadb839 (patch)
treea41fa6abc7a2b3a8f796aaf88895902ba3cb7ca5
parent6c9db8d5b735c599f0a2fbc31f3f70568e6183cc (diff)
downloadxf86-input-wacom-790211e8fb02e309cd71428d46aa175badadb839.tar.gz
Move the server FD handling to the caller of wcmDevOpen/wcmDevClose
This makes both functions independent of the X server behavior now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/xf86Wacom.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index 1b37402..b328bc0 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -521,10 +521,6 @@ static int wcmDevOpen(DeviceIntPtr pWcm)
DBG(10, priv, "\n");
- /* If fd management is done by the server, skip common fd handling */
- if (pInfo->flags & XI86_SERVER_FD)
- return TRUE;
-
/* open file, if not already open */
if (common->fd_refs == 0)
{
@@ -652,10 +648,6 @@ static void wcmDevClose(WacomDevicePtr priv)
InputInfoPtr pInfo = priv->pInfo;
WacomCommonPtr common = priv->common;
- /* If fd management is done by the server, skip common fd handling */
- if (pInfo->flags & XI86_SERVER_FD)
- return;
-
DBG(4, priv, "Wacom number of open devices = %d\n", common->fd_refs);
if (pInfo->fd >= 0)
@@ -698,7 +690,8 @@ static int wcmDevProc(DeviceIntPtr pWcm, int what)
break;
case DEVICE_ON:
- if (!wcmDevOpen(pWcm))
+ /* If fd management is done by the server, skip common fd handling */
+ if ((pInfo->flags & XI86_SERVER_FD) == 0 && !wcmDevOpen(pWcm))
goto out;
wcmStart(priv);
xf86AddEnabledDevice(pInfo);
@@ -714,7 +707,9 @@ static int wcmDevProc(DeviceIntPtr pWcm, int what)
if (pInfo->fd >= 0)
{
xf86RemoveEnabledDevice(pInfo);
- wcmDevClose(priv);
+ /* If fd management is done by the server, skip common fd handling */
+ if ((pInfo->flags & XI86_SERVER_FD) == 0)
+ wcmDevClose(priv);
}
pWcm->public.on = FALSE;
break;