Jeremy White : wintab32: Capture the number of buttons earlier, allowing our button maps to be filled in.

Alexandre Julliard julliard at winehq.org
Wed Dec 26 10:05:05 CST 2007


Module: wine
Branch: master
Commit: f193197a66c052c81d006e4c7ab40247ef7f0411
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f193197a66c052c81d006e4c7ab40247ef7f0411

Author: Jeremy White <jwhite at codeweavers.com>
Date:   Mon Dec 24 13:35:13 2007 -0600

wintab32: Capture the number of buttons earlier, allowing our button maps to be filled in.

---

 dlls/winex11.drv/wintab.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c
index 32db612..c3ad140 100644
--- a/dlls/winex11.drv/wintab.c
+++ b/dlls/winex11.drv/wintab.c
@@ -474,8 +474,8 @@ void X11DRV_LoadTabletInfo(HWND hwnddefault)
                 int shft = 0;
 
                 X11DRV_expect_error(data->display,Tablet_ErrorHandler,NULL);
-                pXGetDeviceButtonMapping(data->display, opendevice, map, 32);
-                if (X11DRV_check_error())
+                cursor->BUTTONS = pXGetDeviceButtonMapping(data->display, opendevice, map, 32);
+                if (X11DRV_check_error() || cursor->BUTTONS <= 0)
                 {
                     TRACE("No buttons, Non Tablet Device\n");
                     pXCloseDevice(data->display, opendevice);
@@ -606,7 +606,8 @@ void X11DRV_LoadTabletInfo(HWND hwnddefault)
                         int i;
 
                         Button = (XButtonInfoPtr) any;
-                        cursor->BUTTONS = Button->num_buttons;
+                        TRACE("    ButtonInput %d: [class %d|length %d|num_buttons %d]\n",
+                                class_loop, (int) Button->class, Button->length, Button->num_buttons);
                         cursor->BTNNAMES = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*cchBuf);
                         for (i = 0; i < cursor->BUTTONS; i++)
                         {




More information about the wine-cvs mailing list