priv->wcmDeviceType contains the guessed device type, after querying the key
state from the kernel. If that found our device type, use it.

Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
 src/wcmUSB.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 64d6105..3f1c839 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1649,6 +1649,13 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
        ds = &common->wcmChannel[channel].work;
        dslast = common->wcmChannel[channel].valid.state;
 
+       /* no device type? tool was on the tablet at startup, force type and
+          proximity */
+       if (!ds->device_type && private->wcmDeviceType) {
+               ds->device_type = private->wcmDeviceType;
+               ds->proximity = 1;
+       }
+
        /* all USB data operates from previous context except relative values*/
        ds->relwheel = 0;
        ds->serial_num = private->wcmLastToolSerial;
-- 
1.8.0.2


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to