wintab fix for NVIDIA

Aric Stewart aric at codeweavers.com
Thu Jan 29 17:28:02 CST 2004


Changelog:
  	The NVIDIA graphics device comes up as an X extension event, but 
throws an error (BadMatch) when querying for the buttons. Catch this 
error and and discard that device from being a tablet device.

LGPL
-------------- next part --------------
Index: dlls/x11drv/wintab.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/wintab.c,v
retrieving revision 1.2
diff -u -w -r1.2 wintab.c
--- dlls/x11drv/wintab.c	20 Jan 2004 22:48:57 -0000	1.2
+++ dlls/x11drv/wintab.c	29 Jan 2004 20:36:06 -0000
@@ -277,6 +277,11 @@
     return 0;
 }
 
+static int Tablet_ErrorHandler(Display *dpy, XErrorEvent *event, void* arg)
+{
+    return 1;
+}
+
 void X11DRV_LoadTabletInfo(HWND hwnddefault)
 {
     struct x11drv_thread_data *data = x11drv_thread_data();
@@ -368,7 +373,15 @@
                 int i;
                 int shft = 0;
 
+                X11DRV_expect_error(data->display,Tablet_ErrorHandler,NULL);
                 pXGetDeviceButtonMapping(data->display, opendevice, map, 32);
+                if (X11DRV_check_error())
+                {
+                    TRACE("No buttons, Non Tablet Device\n");
+                    pXCloseDevice(data->display, opendevice);
+                    cursor_target --;
+                    continue;
+                }
 
                 for (i=0; i< cursor->BUTTONS; i++,shft++)
                 {


More information about the wine-patches mailing list