winex11.drv[2/6]: wintab: skip non-pressure-sensitive devices for wintab32 (patch)

Mikołaj Zalewski mikolaj at zalewski.pl
Thu Aug 30 22:15:11 CDT 2007


  Some comment of the patch is in the previous mail
-------------- next part --------------
>From 2ae75534a8623cd137b1693ee490289322f5fdba Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Miko=C5=82aj_Zalewski?= <mikolaj at zalewski.pl>
Date: Thu, 30 Aug 2007 13:13:34 -0700
Subject: [PATCH] winex11.drv: wintab: skip non-pressure-sensitive devices for wintab32

---
 dlls/winex11.drv/wintab.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c
index 8846342..a776bc0 100644
--- a/dlls/winex11.drv/wintab.c
+++ b/dlls/winex11.drv/wintab.c
@@ -357,6 +357,7 @@ void X11DRV_LoadTabletInfo(HWND hwnddefault)
         if (devices[loop].use == IsXExtensionDevice)
         {
             LPWTI_CURSORS_INFO cursor;
+            BOOL have_pressure = FALSE;
 
             TRACE("Is Extension Device\n");
             cursor_target++;
@@ -420,9 +421,10 @@ void X11DRV_LoadTabletInfo(HWND hwnddefault)
                 switch (any->class)
                 {
                     case ValuatorClass:
-                        if (!axis_read_complete)
+                        Val = (XValuatorInfoPtr) any;
+                        have_pressure = (Val->num_axes >= 3);
+                        if (have_pressure && !axis_read_complete)
                         {
-                            Val = (XValuatorInfoPtr) any;
                             Axis = (XAxisInfoPtr) ((char *) Val + sizeof
                                 (XValuatorInfo));
 
@@ -503,6 +505,13 @@ void X11DRV_LoadTabletInfo(HWND hwnddefault)
                 }
                 any = (XAnyClassPtr) ((char*) any + any->length);
             }
+
+            if (!have_pressure)
+            {
+                WARN("Device is not pressure-sensitive - maybe a laptop touchpad. Skipping.\n");
+                cursor_target--;
+                continue;
+            }
         }
     }
     pXFreeDeviceList(devices);
-- 
1.4.4.2



More information about the wine-patches mailing list