On Fri, Sep 21, 2012 at 12:23 AM, Peter Hutterer <peter.hutte...@who-t.net> wrote: > On Fri, Sep 14, 2012 at 05:07:05PM -0700, Jason Gerecke wrote: >> On Fri, Sep 14, 2012 at 5:04 PM, Jason Gerecke <killert...@gmail.com> wrote: >> > 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 >> > >> >> Seemed like a reasonable enough request, and I'm getting tired of >> having to drop to a TTY just to run evtest (or disable >> xf86-input-wacom to run mtview). :D > > there is a side-effect to this patch. Adding the option is harmless enough > but you also switched the default to false. This can cause some > issues, though wcmIsDuplicate() should take care of that. > > The effect of the EVIOCGRAB is that only one user can get data from > the event device. So if a user has hotplugging enabled but a static > configuration on, say, /dev/input/wacom or some other symlink, the same > device gets added twice. with EVIOCGRAB, that won't be an issue, but without > both readers can get events now. As said above wcmIsDuplicate() should take > care of this, but please make sure this is still the case. > > Coincidentally, this would be a great test to add to > http://cgit.freedesktop.org/~whot/xorg-integration-tests/ > > Cheers, > Peter
Looks like I broke wcmIsDuplicate with commit cff344b1. If only one device has a NULL source (as would happen when comparing a hotplugged device to a static device) then the function doesn't return 'true' like it should. Once that is addressed though, wcmIsDuplicate will take care of ensuring we don't wind up with two copies of the same underlying device. Patch forthcoming. Jason --- When you're rife with devastation / There's a simple explanation: You're a toymaker's creation / Trapped inside a crystal ball. And whichever way he tilts it / Know that we must be resilient We won't let them break our spirits / As we sing our silly song. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel