The NVIDIA graphics device comes up as an X extension event, but
authorAric Stewart <aric@codeweavers.com>
Fri, 30 Jan 2004 22:56:06 +0000 (22:56 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 30 Jan 2004 22:56:06 +0000 (22:56 +0000)
throws an error (BadMatch) when querying for the buttons. Catch this
error and and discard that device from being a tablet device.

dlls/x11drv/wintab.c

index 4d540b55769d1ae97564d4f070c18ee3a8659321..837f2e7a0b4f55b17a268492ef3563d59e43ab84 100644 (file)
@@ -277,6 +277,11 @@ sym_not_found:
     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 @@ void X11DRV_LoadTabletInfo(HWND hwnddefault)
                 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++)
                 {