summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-09-23 08:36:47 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-09-23 08:36:47 +1000
commit960ed57f624e200467d5b7801da0d11337d8eba4 (patch)
tree1dd8c7dcbffba61eb32e02b8ef70a15919bd5870
parentfa9fc75016e3587389040d6b91f03a3b80323a52 (diff)
parent7bbf4624b8be1bcac7a782057b9c2db5e8bbcc75 (diff)
Merge branch 'smooth-scrolling'
Conflicts: src/test_xi2.c
-rw-r--r--configure.ac5
-rw-r--r--src/list.c24
-rw-r--r--src/test_xi2.c11
3 files changed, 38 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 37f998f..5a64837 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,9 +45,12 @@ PKG_CHECK_MODULES(XI2, [xi >= 1.2.99.2] [inputproto >= 1.9.99.15],
HAVE_XI2="yes"; AC_DEFINE(HAVE_XI2, 1, [XI2 available]),
HAVE_XI2="no");
AM_CONDITIONAL(HAVE_XI2, [ test "$HAVE_XI2" = "yes" ])
-
AC_SUBST(HAVE_XI2)
+# XI2.1 support
+PKG_CHECK_MODULES(XI21, [xi >= 1.4.99.1] [inputproto >= 2.0.99.1],
+ AC_DEFINE(HAVE_XI21, 1, [XI2.1 available]));
+
AC_OUTPUT([Makefile
src/Makefile
man/Makefile])
diff --git a/src/list.c b/src/list.c
index 236011e..64848e3 100644
--- a/src/list.c
+++ b/src/list.c
@@ -201,6 +201,30 @@ print_classes_xi2(Display* display, XIAnyClassInfo **classes,
XFree(name);
}
break;
+#if HAVE_XI21
+ case XIScrollClass:
+ {
+ XIScrollClassInfo *s = (XIScrollClassInfo*)classes[i];
+
+ printf("XIScrollClass\n");
+ printf("\t\tScroll info for Valuator %d\n", s->number);
+ printf("\t\t type: %d (%s)\n", s->scroll_type,
+ (s->scroll_type == XIScrollTypeHorizontal) ? "horizontal" :
+ (s->scroll_type == XIScrollTypeVertical) ? "vertical" : "unknown");
+ printf("\t\t increment: %f\n", s->increment);
+ printf("\t\t flags: 0x%x", s->flags);
+ if (s->flags) {
+ printf(" (");
+ if (s->flags & XIScrollFlagNoEmulation)
+ printf(" no-emulation ");
+ if (s->flags & XIScrollFlagPreferred)
+ printf(" preferred ");
+ printf(")");
+ }
+ printf("\n");
+ }
+ break;
+#endif
}
}
diff --git a/src/test_xi2.c b/src/test_xi2.c
index a2cd5d6..4a6c3b6 100644
--- a/src/test_xi2.c
+++ b/src/test_xi2.c
@@ -53,7 +53,7 @@ static void print_deviceevent(XIDeviceEvent* event)
case XI_KeyRelease:
printf(" flags: %s\n", (event->flags & XIKeyRepeat) ? "repeat" : "");
break;
-#ifdef XIPointerEmulated
+#if HAVE_XI21
case XI_ButtonPress:
case XI_ButtonRelease:
case XI_Motion:
@@ -150,6 +150,15 @@ static void print_rawevent(XIRawEvent *event)
printf(" device: %d\n", event->deviceid);
printf(" detail: %d\n", event->detail);
printf(" valuators:\n");
+#if HAVE_XI21
+ switch(event->evtype) {
+ case XI_RawButtonPress:
+ case XI_RawButtonRelease:
+ case XI_RawMotion:
+ printf(" flags: %s\n", (event->flags & XIPointerEmulated) ? "emulated" : "");
+ break;
+ }
+#endif
val = event->valuators.values;
raw_val = event->raw_values;