From: Peter Hutterer Date: Wed, 1 Jun 2011 23:14:40 +0000 (+1000) Subject: Announce support for XI 2.0 to the server. X-Git-Url: https://diplodocus.org/git/xorg-xinput/commitdiff_plain/c51bb9182d1225def39b49ab57612a070e3a192e?ds=sidebyside;hp=--cc Announce support for XI 2.0 to the server. 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 happens to work. With XI 2.1 on the horizon, this may change so make sure we're clamining our version correctly Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau --- c51bb9182d1225def39b49ab57612a070e3a192e 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; }