[PATCH xinput] Announce support for XI 2.0 to the server.

Peter Hutterer peter.hutterer at who-t.net
Wed Jun 1 16:16:37 PDT 2011


Technically, we're required to announce support for XI 2.0 through
XIQueryVersion. The behaviour of XI2 for clients that have not done so is
undefined, it just happened to work so far.

With XI 2.1 on the horizon, this may change so make sure we're clamining our
version correctly.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/xinput.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/xinput.c b/src/xinput.c
index a20f856..64b4887 100644
--- a/src/xinput.c
+++ b/src/xinput.c
@@ -184,6 +184,16 @@ xinput_version(Display	*display)
 	XFree(version);
     }
 
+#if HAVE_XI2
+    /* Announce our supported version so the server treats us correctly. */
+    if (vers >= XI_2_Major)
+    {
+        int maj = 2,
+            min = 0;
+        XIQueryVersion(display, &maj, &min);
+    }
+#endif
+
     return vers;
 }
 
-- 
1.7.5.1



More information about the xorg-devel mailing list