[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-input-aiptek: Changes to 'upstream-unstable'



 .cvsignore       |   19 ---
 .gitignore       |   20 ++++
 configure.ac     |    2 
 man/.cvsignore   |    2 
 man/.gitignore   |    2 
 src/.cvsignore   |    6 -
 src/.gitignore   |    6 +
 src/xf86Aiptek.c |  265 +++++++++++++++++++++++++++++++++----------------------
 src/xf86Aiptek.h |    8 +
 9 files changed, 195 insertions(+), 135 deletions(-)

New commits:
commit a92bf3b53a277928c94aa87f245ccf301c1e7a2d
Author: René van Paassen <Rene.vanPaassen@gmail.com>
Date:   Tue Jan 29 22:42:40 2008 +0100

    Bumped the version to 1.1.1
    
    This version is actually being tested/used by someone with a tablet (me)

diff --git a/configure.ac b/configure.ac
index a346df8..b1fe39a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-input-aiptek],
-        1.1.0,
+        1.1.1,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-input-aiptek)
 

commit 4a8945d179f3ca9c6ca3553d36ce9840228cf84f
Author: René van Paassen <repa@pascua.localdomain>
Date:   Tue Jan 29 22:32:04 2008 +0100

    added #if to handle MiPointer{Current|Get}Screen cases

diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c
index da0cf98..d57d451 100644
--- a/src/xf86Aiptek.c
+++ b/src/xf86Aiptek.c
@@ -221,7 +221,11 @@ xf86AiptekConvert(LocalDevicePtr local,
     AiptekDevicePtr device = (AiptekDevicePtr) local->private;
     int  xSize, ySize;
     int  width, height;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
+    ScreenPtr pScreen = miPointerCurrentScreen();
+#else
     ScreenPtr pScreen = miPointerGetScreen(local->dev);
+#endif
 
     DBG(15, ErrorF(" xf86AiptekConvert(), with: first=%d, num=%d, v0=%d, "
 		   "v1=%d, v2=%d, v3=%d,, v4=%d, v5=%d, x=%d, y=%d\n",

commit 28269504679fd705f5666c450dbf862f91c8ca84
Author: René van Paassen <repa@pascua.localdomain>
Date:   Tue Jan 29 22:29:41 2008 +0100

    moved xf86AiptekClose after RemoveEnabled.., fixes crash VT switch

diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c
index 74813e2..da0cf98 100644
--- a/src/xf86Aiptek.c
+++ b/src/xf86Aiptek.c
@@ -1642,12 +1642,11 @@ xf86AiptekProc(DeviceIntPtr pAiptek, int requestCode)
 
         case DEVICE_OFF:
         {
-            DBG(1, ErrorF("xf86AiptekProc request=%s\n", 
-                            (requestCode == DEVICE_CLOSE) ? "CLOSE" : "OFF"));
+	    DBG(1, ErrorF("xf86AiptekProc request=OFF\n"));
             if (local->fd >= 0)
             {
-                xf86AiptekClose(local);
                 xf86RemoveEnabledDevice(local);
+                xf86AiptekClose(local);
             }
             pAiptek->public.on = FALSE;
         }
@@ -1655,8 +1654,7 @@ xf86AiptekProc(DeviceIntPtr pAiptek, int requestCode)
 
         case DEVICE_CLOSE:
         {
-            DBG(1, ErrorF("xf86AiptekProc request=%s\n", 
-                           (requestCode == DEVICE_CLOSE) ? "CLOSE" : "OFF"));
+  	    DBG(1, ErrorF("xf86AiptekProc request=CLOSE\n"));
             xf86AiptekClose(local);
         }
         break;

commit a23587a1eef2c256ae9d4184405efb74135e13d5
Author: René van Paassen <repa@pascua.localdomain>
Date:   Tue Jan 29 22:24:34 2008 +0100

    Converted xf86msg into debug messages, to prevent filling the log

diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c
index 45732a0..74813e2 100644
--- a/src/xf86Aiptek.c
+++ b/src/xf86Aiptek.c
@@ -223,10 +223,9 @@ xf86AiptekConvert(LocalDevicePtr local,
     int  width, height;
     ScreenPtr pScreen = miPointerGetScreen(local->dev);
 
-    DBG(6, ErrorF("xf86AiptekConvert\n"));
-    xf86Msg(X_CONFIG, " xf86AiptekConvert(), with: first=%d, num=%d, v0=%d, "
-            "v1=%d, v2=%d, v3=%d,, v4=%d, v5=%d, x=%d, y=%d\n",
-            first, num, v0, v1, v2, v3, v4, v5, *x, *y);
+    DBG(15, ErrorF(" xf86AiptekConvert(), with: first=%d, num=%d, v0=%d, "
+		   "v1=%d, v2=%d, v3=%d,, v4=%d, v5=%d, x=%d, y=%d\n",
+		   first, num, v0, v1, v2, v3, v4, v5, *x, *y));
 
     /* Change the screen number if it differs from that which
      * the pointer is currently on
@@ -283,8 +282,8 @@ xf86AiptekConvert(LocalDevicePtr local,
     {
         xf86XInputSetScreen(local, device->screenNo, *x, *y);
     }
-    xf86Msg(X_CONFIG, ": xf86AiptekConvert() exits, with: x=%d, y=%d\n",
-            *x, *y);
+    DBG(15, ErrorF("xf86AiptekConvert() exits, with: x=%d, y=%d\n",
+		   *x, *y));
 
     return TRUE;
 }
@@ -302,9 +301,9 @@ xf86AiptekReverseConvert(LocalDevicePtr local,
     AiptekDevicePtr device = (AiptekDevicePtr) local->private;
     int    xSize, ySize;
 
-    xf86Msg(X_CONFIG, ": xf86AiptekReverseConvert(), with: x=%d, y=%d, "
-            "valuators[0]=%d, valuators[1]=%d\n",
-            x, y, valuators[0], valuators[1] );
+    DBG(15,  ErrorF("xf86AiptekReverseConvert(), with: x=%d, y=%d, "
+		    "valuators[0]=%d, valuators[1]=%d\n",
+		    x, y, valuators[0], valuators[1] ));
 
     /*
      * Adjust by tablet ratio
@@ -315,16 +314,16 @@ xf86AiptekReverseConvert(LocalDevicePtr local,
     valuators[0] = (x*xSize) / screenInfo.screens[device->screenNo]->width;
     valuators[1] = (y*ySize) / screenInfo.screens[device->screenNo]->height;
 
-    DBG(6, ErrorF("converted x,y (%d, %d) to (%d, %d)\n",
+    DBG(15, ErrorF("converted x,y (%d, %d) to (%d, %d)\n",
                     x, y, valuators[0], valuators[1] ));
 
     if (device->screenNo != 0)
     {
         xf86XInputSetScreen(local,device->screenNo,valuators[0], valuators[1]);
     }
-    xf86Msg(X_CONFIG, ": xf86AiptekReverseConvert() exits, with: "
-            "valuators[0]=%d, valuators[1]=%d\n",
-            valuators[0], valuators[1] );
+    DBG(15, ErrorF(": xf86AiptekReverseConvert() exits, with: "
+		   "valuators[0]=%d, valuators[1]=%d\n",
+		   valuators[0], valuators[1] ));
 
     return TRUE;
 }

commit 51a90b36853a98f6ec5f04c54a9d76fddcfa8ad6
Author: Peter Hutterer <peter@cs.unisa.edu.au>
Date:   Thu Jan 17 17:21:38 2008 +1030

    Don't worry about being core pointer if XInput API is > 0.
    
    Server 1.4 and above let all devices be XI devices and the core devices are
    virtual. So we don't have to worry about it in the driver.
    
    This should make the code compatible with both 1.3 and 1.4.

diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c
index 2a38c83..45732a0 100644
--- a/src/xf86Aiptek.c
+++ b/src/xf86Aiptek.c
@@ -339,7 +339,7 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z)
     AiptekDevicePtr device = (AiptekDevicePtr) local->private;
     AiptekCommonPtr common = device->common;
 
-    int bCorePointer, bAbsolute;
+    int bCorePointer = FALSE, bAbsolute;
     int x, y, z, xTilt, yTilt;
 
     if ((DEVICE_ID(device->flags) != common->currentValues.eventType))
@@ -350,7 +350,9 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z)
     }
 
     bAbsolute    = (device->flags & ABSOLUTE_FLAG);
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
     bCorePointer = xf86IsCorePointer(local->dev);
+#endif
 
     /*
      * Normalize X and Y coordinates. This includes dealing

commit f424235dd26fa22bc3830cf9d884d7643abf3568
Author: Peter Hutterer <peter@cs.unisa.edu.au>
Date:   Thu Jan 17 13:24:46 2008 +1030

    Revert "Driver's don't have to worry about being core pointers anymore."
    There's a better way of doing things. See next commit.
    
    This reverts commit 66e0fbb24377ac14b9cf8a80a55253cff13d7913.

diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c
index 1a81e00..2a38c83 100644
--- a/src/xf86Aiptek.c
+++ b/src/xf86Aiptek.c
@@ -339,7 +339,7 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z)
     AiptekDevicePtr device = (AiptekDevicePtr) local->private;
     AiptekCommonPtr common = device->common;
 
-    int bAbsolute;
+    int bCorePointer, bAbsolute;
     int x, y, z, xTilt, yTilt;
 
     if ((DEVICE_ID(device->flags) != common->currentValues.eventType))
@@ -350,6 +350,7 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z)
     }
 
     bAbsolute    = (device->flags & ABSOLUTE_FLAG);
+    bCorePointer = xf86IsCorePointer(local->dev);
 
     /*
      * Normalize X and Y coordinates. This includes dealing
@@ -465,8 +466,11 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z)
     {
         if (!common->previousValues.proximity)
         {
-            xf86PostProximityEvent(local->dev, 1, 0, 5,
+            if (!bCorePointer)
+            {
+                xf86PostProximityEvent(local->dev, 1, 0, 5,
                     x, y, z, xTilt, yTilt);
+            }
         }
 
         if ((bAbsolute &&
@@ -500,10 +504,13 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z)
     }
     else
     {
-        if (common->previousValues.proximity)
+        if (!bCorePointer)
         {
-            xf86PostProximityEvent(local->dev, 0, 0, 5, x, y, z,
-                    xTilt, yTilt);
+            if (common->previousValues.proximity)
+            {
+                xf86PostProximityEvent(local->dev, 0, 0, 5, x, y, z,
+                        xTilt, yTilt);
+            }
         }
         common->previousValues.proximity = 0;
     }

commit e34bc8e774d92bd81dcefbcd341ab3f040a7f144
Author: Peter Hutterer <peter@cs.unisa.edu.au>
Date:   Thu Jan 10 11:27:39 2008 +1030

    Remove redefinition of NEED_XF86_TYPES.

diff --git a/src/xf86Aiptek.h b/src/xf86Aiptek.h
index fac73e2..0e6daa8 100644
--- a/src/xf86Aiptek.h
+++ b/src/xf86Aiptek.h
@@ -66,8 +66,6 @@
 #include <misc.h>
 #include <xf86.h>
 
-#define NEED_XF86_TYPES
-
 #if !defined(DGUX)
 #   include <xisb.h>
 #endif

commit a88dafb63b0e0f3e4557ae75a3ee9a377ea4ef68
Author: Peter Hutterer <peter@cs.unisa.edu.au>
Date:   Thu Jan 10 11:26:49 2008 +1030

    miPointerCurrentScreen is deprecated, miPointerGetScreen is all the rage now.
    
    Untested due to lack of device.

diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c
index 7a4f94f..1a81e00 100644
--- a/src/xf86Aiptek.c
+++ b/src/xf86Aiptek.c
@@ -221,7 +221,7 @@ xf86AiptekConvert(LocalDevicePtr local,
     AiptekDevicePtr device = (AiptekDevicePtr) local->private;
     int  xSize, ySize;
     int  width, height;
-    ScreenPtr pScreen = miPointerCurrentScreen();
+    ScreenPtr pScreen = miPointerGetScreen(local->dev);
 
     DBG(6, ErrorF("xf86AiptekConvert\n"));
     xf86Msg(X_CONFIG, " xf86AiptekConvert(), with: first=%d, num=%d, v0=%d, "

commit 66e0fbb24377ac14b9cf8a80a55253cff13d7913
Author: Peter Hutterer <peter@cs.unisa.edu.au>
Date:   Thu Jan 10 11:25:58 2008 +1030

    Driver's don't have to worry about being core pointers anymore.
    
    The DDX will do the right job, no matter what events we post, so we don't need
    in-driver checks for whether to post proximity events or not.
    
    Untested due to a lack of device.

diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c
index 40d231b..7a4f94f 100644
--- a/src/xf86Aiptek.c
+++ b/src/xf86Aiptek.c
@@ -339,7 +339,7 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z)
     AiptekDevicePtr device = (AiptekDevicePtr) local->private;
     AiptekCommonPtr common = device->common;
 
-    int bCorePointer, bAbsolute;
+    int bAbsolute;
     int x, y, z, xTilt, yTilt;
 
     if ((DEVICE_ID(device->flags) != common->currentValues.eventType))
@@ -350,7 +350,6 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z)
     }
 
     bAbsolute    = (device->flags & ABSOLUTE_FLAG);
-    bCorePointer = xf86IsCorePointer(local->dev);
 
     /*
      * Normalize X and Y coordinates. This includes dealing
@@ -466,11 +465,8 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z)
     {
         if (!common->previousValues.proximity)
         {
-            if (!bCorePointer)
-            {
-                xf86PostProximityEvent(local->dev, 1, 0, 5,
+            xf86PostProximityEvent(local->dev, 1, 0, 5,
                     x, y, z, xTilt, yTilt);
-            }
         }
 
         if ((bAbsolute &&
@@ -504,13 +500,10 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z)
     }
     else
     {
-        if (!bCorePointer)
+        if (common->previousValues.proximity)
         {
-            if (common->previousValues.proximity)
-            {
-                xf86PostProximityEvent(local->dev, 0, 0, 5, x, y, z,
-                        xTilt, yTilt);
-            }
+            xf86PostProximityEvent(local->dev, 0, 0, 5, x, y, z,
+                    xTilt, yTilt);
         }
         common->previousValues.proximity = 0;
     }

commit 3cb825cb4a633132de10df77e792fcbadf082385
Author: Rene van Paassen <rene.vanpaassen@gmail.com>
Date:   Thu Jan 10 11:23:06 2008 +1030

    Patch with a load of fixes, backported from aiptektablet.sourceforge.net
    
    Tested with re-branded aiptek 12000U

diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c
index 9539372..40d231b 100644
--- a/src/xf86Aiptek.c
+++ b/src/xf86Aiptek.c
@@ -4,6 +4,24 @@
  * This driver assumes Linux USB/HID support, available for USB devices.
  * 
  * Version 0.0, 1-Jan-2003, Bryan W. Headley
+ *
+ * Version 1.0 10-jan-2008, Rene van Paassen
+ *  * This version is based on the Xorg driver 1.0.1 version, with 
+ *    fixes based on the version developed at aiptektablet.sourceforge.net
+ *    fixes include - correction of the button status calculation
+ *                    (buttons were never released) 
+ *                  - use stylus as default, because reading the
+ *                    tablet before X start gives no hint as to what device
+ *                    it is producing
+ *                  - correction of the proximity bit detection
+ *                  - although tablet may produce relative (x, y), the z and 
+ *                    tilt values are always absolute, corrected that
+ *                  - relative x and y may be negative sometimes! removed 
+ *                    clipping there
+ *                  - filtering out events only if ALL values are equal to 
+ *                    the, previous not when only one or more is equal + 
+ *                    combined filtering with threshold.
+ *                  
  * 
  * Copyright 2003 by Bryan W. Headley. <bwheadley@earthlink.net>
  *
@@ -203,12 +221,21 @@ xf86AiptekConvert(LocalDevicePtr local,
     AiptekDevicePtr device = (AiptekDevicePtr) local->private;
     int  xSize, ySize;
     int  width, height;
+    ScreenPtr pScreen = miPointerCurrentScreen();
 
     DBG(6, ErrorF("xf86AiptekConvert\n"));
     xf86Msg(X_CONFIG, " xf86AiptekConvert(), with: first=%d, num=%d, v0=%d, "
             "v1=%d, v2=%d, v3=%d,, v4=%d, v5=%d, x=%d, y=%d\n",
             first, num, v0, v1, v2, v3, v4, v5, *x, *y);
 
+    /* Change the screen number if it differs from that which
+     * the pointer is currently on
+     */
+    if (pScreen->myNum != device->screenNo)
+    {
+        device->screenNo = pScreen->myNum;
+    }
+
     if (first != 0 || num == 1)
     {
         return FALSE;
@@ -333,46 +360,54 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z)
     {
         x = common->currentValues.x;
         y = common->currentValues.y;
-        z = r_z;
-        xTilt = common->currentValues.xTilt;
-        yTilt = common->currentValues.yTilt;
-    }
-    else
-    {
-        x = common->currentValues.x - common->previousValues.x;
-        y = common->currentValues.y - common->previousValues.y;
-        z = r_z - common->previousValues.z;
-        xTilt = common->currentValues.xTilt - common->previousValues.xTilt;
-        yTilt = common->currentValues.yTilt - common->previousValues.yTilt;
-    }
 
-    /* Translate coordinates according to Top and Bottom points.
-     */
-    if (x > device->xBottom) {
-        x = device->xBottom;
-    }
+        /* Translate coordinates according to Top and Bottom points.
+         */
+        if (x > device->xBottom) {
+            x = device->xBottom;
+        }
 
-    if (y > device->yBottom) {
-        y = device->yBottom;
-    }
+        if (y > device->yBottom) {
+            y = device->yBottom;
+        }
 
-    if (device->xTop > 0) {
-        DBG(10, ErrorF("Adjusting x, with xTop=%d\n", device->xTop));
-        x -= device->xTop;
-    }
+	if (device->xTop > 0) {
+	    DBG(10, ErrorF("Adjusting x, with xTop=%d\n", device->xTop));
+	    x -= device->xTop;
+	}
 
-    if (device->yTop > 0) {
-        DBG(10, ErrorF("Adjusting y, with yTop=%d\n", device->yTop));
-        y -= device->yTop;
-    }
+	if (device->yTop > 0) {
+	    DBG(10, ErrorF("Adjusting y, with yTop=%d\n", device->yTop));
+	    y -= device->yTop;
+	}
+
+	if (x < 0) {
+	    x = 0;
+	}
+	if (y < 0) {
+	    y = 0;
+	}
 
-    if (x < 0) {
-        x = 0;
     }
-    if (y < 0) {
-        y = 0;
+    else
+    {
+        if (common->previousValues.proximity != 0)
+        {
+            x = common->currentValues.x - common->previousValues.x;
+            y = common->currentValues.y - common->previousValues.y;
+        }
+        else
+        {
+            x = 0;
+            y = 0;
+        }
     }
 
+    z = r_z;
+    xTilt = common->currentValues.xTilt;
+    yTilt = common->currentValues.yTilt;
+
+    
     /* Deal with pressure min..max, which differs from threshold. */
     if (z < device->zMin) {
         z = 0;
@@ -594,7 +629,7 @@ xf86AiptekHIDReadInput(LocalDevicePtr local)
                          */
                         ++eventsInMessage;
                         common->currentValues.proximity = 
-                            (event->value > 0 ? 1 : 0);
+                            PROXIMITY(event->value) ? 1 : 0;
                     }
                     break;
                 }
@@ -649,7 +684,7 @@ xf86AiptekHIDReadInput(LocalDevicePtr local)
                          */
                         ++eventsInMessage;
                         common->currentValues.proximity = 
-                            (event->value > 0 ? 1 : 0);
+                            PROXIMITY (event->value) ? 1 : 0;
                     }
                     break;
                 }
@@ -711,24 +746,36 @@ xf86AiptekHIDReadInput(LocalDevicePtr local)
                     case BTN_TOUCH:
                     {
                         ++eventsInMessage;
-                        common->currentValues.button |= 
-                            (event->value > 0 ? 1 : 0) * BUTTONS_EVENT_TOUCH;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_TOUCH;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_TOUCH;
                     }
                     break;
 
                     case BTN_STYLUS:
                     {
                         ++eventsInMessage;
-                        common->currentValues.button |= 
-                            (event->value > 0 ? 1 : 0) * BUTTONS_EVENT_STYLUS;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_STYLUS;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_STYLUS;
                     }
                     break;
 
                     case BTN_STYLUS2:
                     {
                         ++eventsInMessage;
-                        common->currentValues.button |= 
-                            (event->value > 0 ? 1 : 0) * BUTTONS_EVENT_STYLUS2;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_STYLUS2;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_STYLUS2;
                     }
                     break;
 
@@ -742,40 +789,60 @@ xf86AiptekHIDReadInput(LocalDevicePtr local)
                     case BTN_LEFT:
                     {
                         ++eventsInMessage;
-                        common->currentValues.button |= 
-                            (event->value > 0 ? 1 : 0) * BUTTONS_EVENT_MOUSE_LEFT;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_MOUSE_LEFT;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_MOUSE_LEFT;
                     }
                     break;
 
                     case BTN_MIDDLE:
                     {
                         ++eventsInMessage;
-                        common->currentValues.button |= 
-                            (event->value > 0 ? 1 : 0) * BUTTONS_EVENT_MOUSE_MIDDLE;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_MOUSE_MIDDLE;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_MOUSE_MIDDLE;
                     }
                     break;
 
                     case BTN_RIGHT:
                     {
                         ++eventsInMessage;
-                        common->currentValues.button |= 
-                            (event->value > 0 ? 1 : 0) * BUTTONS_EVENT_MOUSE_RIGHT;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_MOUSE_RIGHT;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_MOUSE_RIGHT;
                     }
                     break;
 
                     case BTN_SIDE:
                     {
                         ++eventsInMessage;
-                        common->currentValues.button |= 
-                            (event->value > 0 ? 1 : 0) * BUTTONS_EVENT_SIDE_BTN;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_SIDE_BTN;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_SIDE_BTN;
                     }
                     break;
 
                     case BTN_EXTRA:
                     {
                         ++eventsInMessage;
-                        common->currentValues.button |= 
-                            (event->value > 0 ? 1 : 0) * BUTTONS_EVENT_EXTRA_BTN;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_EXTRA_BTN;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_EXTRA_BTN;
                     }
                     break;
 
@@ -842,45 +909,28 @@ xf86AiptekHIDReadInput(LocalDevicePtr local)
          * Also, we only do the comparison IFF a threshold has been set
          * for that given dimension.
          */
-        if ((device->xThreshold > 1 && 
-                ABS(common->currentValues.x - common->previousValues.x)
-                    <= device->xThreshold) ||
-            (device->yThreshold > 1 &&
-                ABS(common->currentValues.y - common->previousValues.y)
-                    <= device->yThreshold) ||
-            (device->zThreshold > 1 &&
-                ABS(common->currentValues.z - common->previousValues.z)
-                    <= device->zThreshold) ||
-            (device->xTiltThreshold > 1 &&
-                ABS(common->currentValues.xTilt - common->previousValues.xTilt)
-                    <= device->xTiltThreshold) ||
-            (device->yTiltThreshold > 1 &&
-                ABS(common->currentValues.yTilt - common->previousValues.yTilt)
-                    <= device->yTiltThreshold))
+        if (ABS(common->currentValues.x - common->previousValues.x)
+                    <= device->xThreshold &&
+            ABS(common->currentValues.y - common->previousValues.y)
+                    <= device->yThreshold &&
+            ABS(common->currentValues.z - common->previousValues.z)
+                    <= device->zThreshold &&
+            ABS(common->currentValues.xTilt - common->previousValues.xTilt)
+                    <= device->xTiltThreshold &&
+            ABS(common->currentValues.yTilt - common->previousValues.yTilt)
+                    <= device->yTiltThreshold &&
+	    common->currentValues.proximity == 
+                    common->previousValues.proximity &&
+            common->currentValues.button ==
+                    common->previousValues.button &&
+            common->currentValues.macroKey ==
+                    common->previousValues.macroKey)
         {
             DBG(10, ErrorF("Event Filtered Out by Thresholds\n"));
             continue;
         }
 
         /*
-         * If this report somehow has exactly the same readings as the
-         * previous report for all dimensions, throw the report out.
-         */
-        if ((common->currentValues.x == common->previousValues.x) &&
-            (common->currentValues.y == common->previousValues.y) &&
-            (common->currentValues.z == common->previousValues.z) &&
-            (common->currentValues.proximity == 
-                                         common->previousValues.proximity) &&
-            (common->currentValues.button == 
-                                         common->previousValues.button) &&
-            (common->currentValues.macroKey ==
-                                         common->previousValues.macroKey))
-        {
-            DBG(10, ErrorF("Event Filtered Out\n"));
-            continue;
-        }
-
-        /*
          * We have three different methods by which we report pressure, Z.
          * One is to use linear values from 0 to common->zCapacity. The
          * other two, SOFT_SMOOTH and HARD_SMOOTH, use different
@@ -1809,8 +1859,10 @@ xf86AiptekAllocate(char* name,
     device->common =        common;   /* Common info pointer */
 
     /* Record of the event currently being read of the queue */
-    common->currentValues.eventType = 0;   /* Device event is for, e.g., */
-                                            /* STYLUS, RUBBER, CURSOR */
+    common->currentValues.eventType = STYLUS_ID;   
+                                      /* Device event is for, e.g., */
+                                      /* STYLUS, RUBBER, CURSOR */
+                                      /* Starting with stylus as default */
     common->currentValues.x         = 0;   /* X coordinate */
     common->currentValues.y         = 0;   /* Y coordinate */
     common->currentValues.z         = 0;   /* Z (pressure) */
diff --git a/src/xf86Aiptek.h b/src/xf86Aiptek.h
index c79682f..fac73e2 100644
--- a/src/xf86Aiptek.h
+++ b/src/xf86Aiptek.h
@@ -98,6 +98,12 @@
 #define XI_CURSOR           "CURSOR"    /* X device name for the cursor */
 #define XI_ERASER           "ERASER"    /* X device name for the eraser */
 
+/***********************************************************************
+ * We ship the proximity bit through EV_MISC, ORed with information
+ * as to whether report came from the stylus or tablet mouse.
+ */
+#define PROXIMITY(flags)            ((flags) & 0x0F)
+
 /* macro from counts/inch to counts/meter */
 #define LPI2CPM(res)    (res * 1000 / 25.4)
 

commit afedccae164668128c6228542585cc27d241b7e6
Author: James Cloos <cloos@jhcloos.com>
Date:   Mon Sep 3 05:52:01 2007 -0400

    Add *~ to .gitignore to skip patch/emacs droppings

diff --git a/.gitignore b/.gitignore
index fb1befd..2df4a8d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,4 @@ libtool
 ltmain.sh
 missing
 stamp-h1
+*~

commit 432145c8c4ec06710f139112aeee96fdc19c5f92
Author: James Cloos <cloos@jhcloos.com>
Date:   Thu Aug 23 19:25:19 2007 -0400

    Rename .cvsignore to .gitignore

diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index fb1befd..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1,19 +0,0 @@
-Makefile
-Makefile.in
-*.la
-*.lo
-aclocal.m4
-autom4te.cache
-config.guess
-config.h
-config.h.in
-config.log
-config.status
-config.sub
-configure
-depcomp
-install-sh
-libtool
-ltmain.sh
-missing
-stamp-h1
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fb1befd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,19 @@
+Makefile
+Makefile.in
+*.la
+*.lo
+aclocal.m4
+autom4te.cache
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+libtool
+ltmain.sh
+missing
+stamp-h1
diff --git a/man/.cvsignore b/man/.cvsignore
deleted file mode 100644
index 282522d..0000000
--- a/man/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/man/.gitignore b/man/.gitignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/man/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/src/.cvsignore b/src/.cvsignore
deleted file mode 100644
index 9730646..0000000
--- a/src/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.la
-*.lo
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..9730646
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,6 @@
+.deps
+.libs
+Makefile
+Makefile.in
+*.la
+*.lo

commit 1733fc06082f982b0f0d57bac9632f3ece8f4c34
Author: Brice Goglin <bgoglin@debian.org>
Date:   Mon Aug 6 19:32:29 2007 +0200

    Use PACKAGE_VERSION_MAJOR/MINOR/PATCHLEVEL in xf86AiptekVersionRec

diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c
index 2eea74e..9539372 100644
--- a/src/xf86Aiptek.c
+++ b/src/xf86Aiptek.c
@@ -2443,7 +2443,7 @@ static XF86ModuleVersionInfo xf86AiptekVersionRec =
     MODINFOSTRING1,
     MODINFOSTRING2,
     XORG_VERSION_CURRENT,
-    1, 1, 0,
+    PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
     ABI_CLASS_XINPUT,
     ABI_XINPUT_VERSION,
     MOD_CLASS_XINPUT,

commit c0f5a94625ed8e7ab326b3b604e8f7461921c027
Author: Brice Goglin <bgoglin@debian.org>
Date:   Mon Aug 6 19:32:26 2007 +0200

    Fix 1.1.0 version in configure.ac

diff --git a/configure.ac b/configure.ac
index 5d1b8ae..a346df8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-input-aiptek],
-        1.0.1,
+        1.1.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-input-aiptek)
 


Reply to: