]> diplodocus.org Git - xorg-xinput/commitdiff
Rip HAVE_XI2 conditional functionality out.
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 26 Feb 2009 06:09:17 +0000 (16:09 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Sat, 21 Mar 2009 12:05:32 +0000 (22:05 +1000)
XI2 needs to be harder separated now.

src/list.c
src/xinput.c

index de8aca7981f41a68e49eb105d08e70de3cc0c893..3d40987e68f059049c759e669d2bfad0f32ff813 100644 (file)
@@ -34,9 +34,6 @@ print_info(XDeviceInfo        *info, Bool shortformat)
     XButtonInfoPtr     b;
     XValuatorInfoPtr   v;
     XAxisInfoPtr       a;
-#if HAVE_XI2
-    XAttachInfoPtr      att;
-#endif
 
     printf("\"%s\"\tid=%ld\t[", info->name, info->id);
 
@@ -95,12 +92,6 @@ print_info(XDeviceInfo       *info, Bool shortformat)
                    printf ("\t\tResolution is %d\n", a->resolution);
                }
                break;
-#if HAVE_XI2
-            case AttachClass:
-                att = (XAttachInfoPtr)any;
-                printf("\tAttached to %d\n", att->attached);
-                break;
-#endif
            default:
                printf ("unknown class\n");
            }
@@ -126,44 +117,12 @@ list(Display      *display,
 
     if (argc == 0 || shortformat || daemon) {
        int             num_devices;
-        XEvent  ev;
-
-#if HAVE_XI2
-        if (daemon)
-        {
-            XiSelectEvent(display, DefaultRootWindow(display), NULL,
-                          XI_DeviceHierarchyChangedMask |
-                          XI_DeviceClassesChangedMask);
-        }
-#endif
 
         do {
             info = XListInputDevices(display, &num_devices);
             for(loop=0; loop<num_devices; loop++) {
                 print_info(info+loop, shortformat);
             }
-
-#if HAVE_XI2
-            /* just wait for the next generic event to come along */
-            while (daemon && !XNextEvent(display, &ev))
-            {
-                if (ev.type == GenericEvent)
-                {
-                    XGenericEvent* gev = (XGenericEvent*)&ev;
-                    /* we just assume that extension is IReqCode, pretty save
-                       since we don't register for other events. */
-                    if (gev->evtype == XI_DeviceHierarchyChangedNotify)
-                    {
-                        printf("Hierarchy change.\n");
-                    } else if (gev->evtype == XI_DeviceClassesChangedNotify)
-                    {
-                        printf("Device classes changed.\n");
-                        free(((XDeviceClassesChangedEvent*)&ev)->inputclassinfo);
-                    }
-                    break;
-                }
-            }
-#endif
         } while(daemon);
     } else {
        int     ret = EXIT_SUCCESS;
index 1ee8bbf8b577bb033685964dca6a6d0f0a00b7b2..082175a7f24a0bf1f1df90f5a0c05074d6abb2e6 100644 (file)
@@ -141,11 +141,7 @@ is_xinput_present(Display  *display)
     XExtensionVersion  *version;
     Bool               present;
 
-#if HAVE_XI2
-    version = XQueryInputVersion(display, XI_2_Major, XI_2_Minor);
-#else
     version = XGetExtensionVersion(display, INAME);
-#endif
 
     if (version && (version != (XExtensionVersion*) NoSuchExtension)) {
        present = version->present;