On Wed, Aug 13, 2014 at 5:30 PM, Peter Hutterer <peter.hutte...@who-t.net> wrote: > On Tue, Aug 12, 2014 at 11:49:37AM -0700, Jason Gerecke wrote: >> On Tue, Aug 5, 2014 at 9:51 PM, Peter Hutterer <peter.hutte...@who-t.net> >> wrote: >> > On Thu, Jul 24, 2014 at 12:04:02PM -0700, Jason Gerecke wrote: >> >> Currently pointer arbitration is taken care of through the use of >> >> a 'wcomPenInProx' variable in the WacomCommonRec. If two devices >> >> share a 'common' variable, the commonDispatchDevice function will >> >> ensure that touches do not move the pointer while the pen is in >> >> proximity. >> >> >> >> This patch adds support for cross-device pointer arbitration to >> >> prevent other touches known to the driver from moving the pointer. >> >> This is achieved with the introduction of a 'WACOM_DRIVER' structure >> >> that is shared by all tools. Inside this structure is an 'active' >> >> variable that keeps track of the last tool which was actively >> >> controlling the pointer. When an event from any tool comes in, the >> >> driver will attempt to determine if it should be filtered or not. >> >> In some cases, the new device will be allowed to take control of >> >> the pointer, and become the new active device. >> >> >> >> Note that arbitration occurs *after* we store the device state >> >> to pChannel->valid.state. The code in wcmTouchFilter.c assumes >> >> that states are not missing, and can become desynchronized from >> >> reality if (for example) a finger were to go out of prox without >> >> a corresponding state update. >> >> >> >> Signed-off-by: Jason Gerecke <killert...@gmail.com> >> >> --- >> >> src/wcmCommon.c | 69 >> >> ++++++++++++++++++++++++++++++++++++----------------- >> >> src/xf86WacomDefs.h | 8 ++++++- >> >> 2 files changed, 54 insertions(+), 23 deletions(-) >> >> >> >> diff --git a/src/wcmCommon.c b/src/wcmCommon.c >> >> index 5bcd755..4e7098a 100644 >> >> --- a/src/wcmCommon.c >> >> +++ b/src/wcmCommon.c >> >> @@ -28,6 +28,11 @@ >> >> #include <xkbsrv.h> >> >> #include <xf86_OSproc.h> >> >> >> >> + >> >> +struct _WacomDriverRec WACOM_DRIVER = { >> >> + .active = NULL, >> >> +}; >> > >> > just to make sure: you're intending to block events from other, unrelated >> > devices if multiple tablets are connected? say, block touch from an I5 >> > while >> > a pen is active on a cintiq. >> > >> That's correct. At the moment the X driver can only do arbitration if >> the devices share the same USB ID. This isn't always sufficient, and >> we rely on the kernel to work out the trickier cases. This isn't as >> clever as the kernel's arbitration logic, but its brute-force approach >> can actually work out well for tablet PC users... If an xorg.conf.d >> rule is added to route all touchscreens to xf86-input-wacom, >> arbitration will (finally) occur between the pen and touch even if >> they're from different manufacturers. I'd like to know what your >> thoughts are on that... > > for the X driver, there isn't much we can do without some extra amount of > effort. I guess we could improve this with finer-grained arbitration based > on device types, e.g. skip this arbitration if the two devices in question > are two Intuos tablets. > > what does worry me though is that the driver has no idea of the use of the > device. In the (quite rare) case of an MPX setup, you've now pretty much > blocked the devices from working simultaneously but independently - which is > rather the point of MPX, even though I'm not aware of a current setup that > makes use of this. The same would be true if the device is set floating but > that too is seen in the wild about as often as a yeti. > > I don't have a good solution here, short of another option that's going to > be quite hard to work out properly. The tablet-pc case is more likely to > happen than the MPX setup and we don't have a way in the driver to handle > the latter anyway, so I'm giving this a i-wish-life-was-simpler > Acked-by: Peter Hutterer <peter.hutte...@who-t.net>. > > Cheers, > Peter > I considered adding a new option to the driver which would let the user disable cross-device arbitration, but didn't believe it to be worth the maintenance given how few MPX setups are out there . In theory somebody could still probably use minor xorg.conf.d voodoo to selectively route the touchscreen to a different driver, but that's not exactly ideal either...
Jason --- Now instead of four in the eights place / you’ve got three, ‘Cause you added one / (That is to say, eight) to the two, / But you can’t take seven from three, / So you look at the sixty-fours.... ------------------------------------------------------------------------------ _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel