diff options
Diffstat (limited to 'app/xsetpointer/xsetpointer.c')
-rw-r--r-- | app/xsetpointer/xsetpointer.c | 56 |
1 files changed, 10 insertions, 46 deletions
diff --git a/app/xsetpointer/xsetpointer.c b/app/xsetpointer/xsetpointer.c index 25a115d52..a3b69cc96 100644 --- a/app/xsetpointer/xsetpointer.c +++ b/app/xsetpointer/xsetpointer.c @@ -59,28 +59,20 @@ StrCaseCmp(char *s1, char *s2) int main(int argc, char * argv[]) { - int loop, num_extensions, num_devices; - char **extensions; - XDeviceInfo *devices; - XDeviceCoreControl corectl; - Display *dpy; - int list = 0, core = 0; - XDevice *device; + int loop, num_extensions, num_devices; + char **extensions; + XDeviceInfo *devices; + Display *dpy; + int list = 0; - if (argc < 2 || argc > 3) { - fprintf(stderr, "usage : %s (-l | -c | +c ) <device name>)\n", argv[0]); + if (argc != 2) { + fprintf(stderr, "usage : %s (-l | <device name>)\n", argv[0]); exit(1); } if (strcmp(argv[1], "-l") == 0) { list = 1; } - else if (strcmp(argv[1], "-c") == 0) { - core = 1; - } - else if (strcmp(argv[1], "+c") == 0) { - core = 2; - } dpy = XOpenDisplay(NULL); @@ -114,45 +106,18 @@ main(int argc, char * argv[]) case IsXExtensionDevice: printf("XExtensionDevice]\n"); break; - case IsXExtensionKeyboard: - printf("XExtensionKeyboard]\n"); - break; - case IsXExtensionPointer: - printf("XExtensionPointer]\n"); - break; default: printf("invalid value]\n"); break; } } - else if (core) { - if (argc == 3 && devices[loop].name && - StrCaseCmp(devices[loop].name, argv[2]) == 0) { -#ifdef DEBUG - fprintf(stderr, "opening device %s at %d\n", - devices[loop].name ? devices[loop].name : "<noname>", - devices[loop].id); -#endif - device = XOpenDevice(dpy, devices[loop].id); - if (device) { - corectl.status = (core - 1); - corectl.length = sizeof(corectl); - corectl.control = DEVICE_CORE; - XChangeDeviceControl(dpy, device, DEVICE_CORE, - (XDeviceControl *)&corectl); - exit(0); - } - else { - fprintf(stderr, "error opening device\n"); - exit(1); - } - } - } else { if ((argc == 2) && devices[loop].name && (StrCaseCmp(devices[loop].name, argv[1]) == 0)) if (devices[loop].use == IsXExtensionDevice) { + XDevice *device; + #ifdef DEBUG fprintf(stderr, "opening device %s\n", devices[loop].name ? devices[loop].name : "<noname>"); @@ -183,8 +148,7 @@ main(int argc, char * argv[]) exit(0); } else { - fprintf(stderr, "Extended device %s not found\n", core ? argv[2] : - argv[1]); + fprintf(stderr, "Extended device %s not found\n", argv[1]); exit(1); } } |