summaryrefslogtreecommitdiffstats
path: root/x11-drivers/xf86-input-wacom/files/patch-src-xf86Wacom.c
blob: 3f2e4f13414f85e6d1a110ba1d5045ae9d9705de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- src/xf86Wacom.c.orig	2017-02-24 04:04:55 UTC
+++ src/xf86Wacom.c
@@ -667,6 +667,17 @@ void wcmReadPacket(InputInfoPtr pInfo)
 
 	if (len <= 0)
 	{
+		/* BSD specific code. */
+		/* Hotplug code does not send remove dev notify because
+		 * opened cuse dev cant be removed. */
+		if (priv->isParent && errno == EINVAL) {
+			WacomDevicePtr other;
+			for (other = common->wcmDevices; other; other = other->next) {
+				xf86Msg(X_INFO, "%s: removing automatically added device.\n",
+					other->pInfo->name);
+				DeleteInputDeviceRequest(other->pInfo->dev);
+			}
+		} else
 		/* for all other errors, hope that the hotplugging code will
 		 * remove the device */
 		if (errno != EAGAIN && errno != EINTR)
@@ -823,9 +834,7 @@ static void wcmUnlinkTouchAndPen(InputIn
 static int wcmDevProc(DeviceIntPtr pWcm, int what)
 {
 	InputInfoPtr pInfo = (InputInfoPtr)pWcm->public.devicePrivate;
-#ifdef DEBUG
 	WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
-#endif
 	Status rc = !Success;
 
 	DBG(2, priv, "BEGIN dev=%p priv=%p "
OpenPOWER on IntegriCloud