[PATCH] xinput: include device type in device list
Simon Thum
simon.thum at gmx.de
Thu Mar 26 05:52:15 PDT 2009
---
src/list.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/list.c b/src/list.c
index de8aca7..bd71a5c 100644
--- a/src/list.c
+++ b/src/list.c
@@ -26,7 +26,7 @@
#include <X11/extensions/XIproto.h> /* for XI_Device***ChangedNotify */
static void
-print_info(XDeviceInfo *info, Bool shortformat)
+print_info(Display* dpy, XDeviceInfo *info, Bool shortformat)
{
int i,j;
XAnyClassPtr any;
@@ -65,6 +65,9 @@ print_info(XDeviceInfo *info, Bool shortformat)
if (shortformat)
return;
+ if(info->type != None)
+ printf("\tType is %s\n", XGetAtomName(dpy, info->type));
+
if (info->num_classes > 0) {
any = (XAnyClassPtr) (info->inputclassinfo);
for (i=0; i<info->num_classes; i++) {
@@ -140,7 +143,7 @@ list(Display *display,
do {
info = XListInputDevices(display, &num_devices);
for(loop=0; loop<num_devices; loop++) {
- print_info(info+loop, shortformat);
+ print_info(display, info+loop, shortformat);
}
#if HAVE_XI2
@@ -175,7 +178,7 @@ list(Display *display,
fprintf(stderr, "unable to find device %s\n", argv[loop]);
ret = EXIT_FAILURE;
} else {
- print_info(info, shortformat);
+ print_info(display, info, shortformat);
}
}
return ret;
--
1.6.0.6
--------------080606040309010904020003
Content-Type: text/plain;
name="0002-xinput-new-syntax-to-select-devices-by-type.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename*0="0002-xinput-new-syntax-to-select-devices-by-type.patch"
More information about the xorg-devel
mailing list