Like in recent versions of xf86-input-evdev, grabbing the input device
with EVIOCGRAB should be optional. This would enable for example
indicator applets, and would improve dynamic handling of different input
devices.

Proposed patch extended to document new GrabDevice driver option.

https://sourceforge.net/tracker/?func=detail&aid=3509828&group_id=69596&atid=525124

Reported-by: H Sundelin
---
 man/wacom.man |  6 ++++++
 src/wcmUSB.c  | 17 +++++++++--------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/man/wacom.man b/man/wacom.man
index e938cf5..0502860 100644
--- a/man/wacom.man
+++ b/man/wacom.man
@@ -197,6 +197,12 @@ paths on the tablet. There are 12 levels, specified by the 
integers between
 "number" will be logged into the Xorg log file. This option is only
 available if the driver was built with debugging support.
 .TP 4
+.B Option \fI"GrabDevice"\fP \fI"bool"\fP
+sets whether the underlying event device will be grabbed by the driver to
+prevent the data from leaking to /dev/input/mice. When enabled, while the
+X server is running, no other programs will be able to read the event
+stream.  Default: "false".
+.TP 4
 .B Option \fI"CursorProx"\fP \fI"number"\fP
 sets the max distance from tablet to stop reporting movement for cursor in 
relative mode. 
 Default for Intuos series is 10, for Graphire series (including Volitos) is
diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index f25116b..b970e1c 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -138,16 +138,17 @@ usbStart(InputInfoPtr pInfo)
 {
        int err;
 
-#ifdef EVIOCGRAB
-       /* Try to grab the event device so that data don't leak to 
/dev/input/mice */
-       SYSCALL(err = ioctl(pInfo->fd, EVIOCGRAB, (pointer)1));
-
-       /* this is called for all tools, so all but the first one fails with
-        * EBUSY */
-       if (err < 0 && errno != EBUSY)
+       if (xf86CheckBoolOption(pInfo->options, "GrabDevice", 0))
+         {
+           /* Try to grab the event device so that data don't leak to 
/dev/input/mice */
+           SYSCALL(err = ioctl(pInfo->fd, EVIOCGRAB, (pointer)1));
+
+           /* this is called for all tools, so all but the first one fails with
+            * EBUSY */
+           if (err < 0 && errno != EBUSY)
                xf86Msg(X_ERROR, "%s: Wacom X driver can't grab event device 
(%s)\n",
                                pInfo->name, strerror(errno));
-#endif
+         }
        return Success;
 }
 
-- 
1.7.12


------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to