The prerequisite check in wcmUpdateSerial is incorrect. If the tool ID
changes, the property reflecting it will not be updated unless/until the
serial number also changes. The check is updated to reflect this.

Additionally, the prerequesite check at one of its callsites is removed
since the function performs the same check internally.

https://bugs.freedesktop.org/show_bug.cgi?id=45237

Signed-off-by: Jason Gerecke <killert...@gmail.com>
---
 src/wcmCommon.c   | 3 +--
 src/wcmXCommand.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index cb76d5a..73bdacf 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -694,8 +694,7 @@ void wcmSendEvents(InputInfoPtr pInfo, const 
WacomDeviceState* ds)
                return;
        }
 
-       if (priv->cur_serial != serial || priv->cur_device_id != id)
-               wcmUpdateSerial(pInfo, serial, id);
+       wcmUpdateSerial(pInfo, serial, id);
 
        /* don't move the cursor when going out-prox */
        if (!ds->proximity)
diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index c3a2a7c..d53df08 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -925,7 +925,7 @@ wcmUpdateSerial(InputInfoPtr pInfo, unsigned int serial, 
int id)
 {
        WacomDevicePtr priv = pInfo->private;
 
-       if (priv->cur_serial == serial)
+       if (priv->cur_serial == serial && priv->cur_device_id == id)
                return;
 
        priv->cur_serial = serial;
-- 
1.7.12.2


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to