We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2306 - XInput2 version 2.2 is not detected
Summary: XInput2 version 2.2 is not detected
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-14 17:39 UTC by Sylvain
Modified: 2014-03-02 09:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvain 2013-12-14 17:39:28 UTC
Hello,

I compiled SDL with XINPUT2 SUPPORTS MULTITOUCH.

But XInput 2.2 is not detected at runtime ! Because XIQueryVersion is called twice. First time with 2.0, then with 2.2.

The first call *sets* the version to 2.0, so that the second call returns 2.0 (and so "xinput2_multitouch_supported = 1;" is never done).

According to documentation (http://manpages.ubuntu.com/manpages/quantal/man3/XIQueryVersion.3.html): 

"Consecutive calls to XIQueryVersion by the same client always return the first returned major.minor version"

If I remove the first call to XIQueryVersion, then it is ok.

It looks like it was ok before: https://hg.libsdl.org/SDL/rev/5d85b2186aae 


Thanks.

Sylvain

## xinput -version
xinput version 1.6.0
XI version on server: 2.3

## Xorg -version
X.Org X Server 1.14.3
Release Date: 2013-09-12
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-37-generic x86_64 Ubuntu
Current Operating System: Linux 3.11.0-14-generic #21-Ubuntu SMP Tue
Comment 1 Ryan C. Gordon 2013-12-14 20:47:16 UTC
Crap, we changed this to fix a different bug.

I wasn't aware it would return the original value on a second call; I'll take another look at this.

--ryan.
Comment 2 Ryan C. Gordon 2014-03-02 07:01:49 UTC
(In reply to Ryan C. Gordon from comment #1)
> Crap, we changed this to fix a different bug.

This should be fixed (for this bug report and the previous concern) with this changeset:

    https://hg.libsdl.org/SDL/rev/176891c01b3c

--ryan.
Comment 3 Sylvain 2014-03-02 09:06:52 UTC
yes, on my side, this gets correctly set and detected now! thanks!