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 621

Summary: Pointing devices enumerated in reverse
Product: SDL Reporter: Gerry JJ <trick>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P4    
Version: HG 2.0   
Hardware: x86   
OS: Linux   
Attachments: xorg.conf

Description Gerry JJ 2008-09-02 23:39:28 UTC
Mice and tablets seems to be enumerated in reverse in current 1.3 SVN (revision 4079).  When I run testmmousetablet in the test directory, I get:

$ ./testmmousetablet 
Initing...                                 
4 pointing devices found                   
device index: 0 name:cursor                
device index: 1 name:eraser                
device index: 2 name:stylus
device index: 3 name:Mouse0
(..)

This is the exact opposite of the order these devices are configured in my xorg.conf.  I'd expect the order to be the same as the configured one.  (I'd also expect the primary mouse to be at index 0 regardless of definition order.)
Comment 1 Donny Viszneki 2008-11-26 00:35:25 UTC
(In reply to comment #0)
> This is the exact opposite of the order these devices are configured in my
> xorg.conf.

Can you please attach your xorg.conf?
Comment 2 Gerry JJ 2008-12-10 05:26:35 UTC
Created attachment 283 [details]
xorg.conf

Sure. Attached.

I recently updated to Xorg 1.5 btw, and the output's a little different now (with same xorg.conf, latest SDL svn):

$ ./testmmousetablet
Initing...
5 pointing devices found
device index: 0 name:stylus
device index: 1 name:eraser
device index: 2 name:cursor
device index: 3 name:PS2++ Logitech MX Mouse
device index: 4 name:Macintosh mouse button emulation
Quitting

(I'm not on a mac, no idea why there's mac mouse button emulation there.)

As for why this is a problem, there's this for example:

$ ./testcursor
Couldn't initialize test cursor: Current mouse doesn't have cursor support

I'm not sure exactly what's the bug here though.

* Mouse defaults to device #0, which may not be primary pointing device.
* No way to get primary pointing device id.
* Tablet devices doesn't support cursors.
Comment 3 Gerry JJ 2008-12-10 05:43:17 UTC
Er, probably should've tested this before, but tried to insert SDL_SelectMouse(3) into the testcursor program, and it still fails, so that's apparently a different bug.  (It still seems weird that the primary device isn't #0 though.)
Comment 4 Sam Lantinga 2009-02-16 21:11:33 UTC
I don't have a tablet device to test with.  Can you look into it a little further, or maybe loan me a tablet for testing?

Thanks!
Comment 5 Ryan C. Gordon 2009-02-18 23:13:52 UTC
I have a cheapie USB Wacom tablet in the closet, if you want me to mail it to you, but let's see if we can get this fixed without involving the postal service, first.

--ryan.
Comment 6 Gerry JJ 2009-02-25 12:27:27 UTC
Hey, sorry for not popping by here more often.  Sending my tablet to you isn't very practical, since I'm on the other side of the globe from you and need to use it regularly.  I'll be happy to help look further into this though, but I'm not very familiar with the source, or how the X input system works, so I'm not sure how much help I can be..  I can sure give it a try though.  Is there anything in particular you want me to try, or should I just start poking around?
Comment 7 Sam Lantinga 2009-12-14 22:34:42 UTC
I'll take a look at the multi-mouse code, coordinating with Ryan.
Comment 8 Sam Lantinga 2009-12-14 22:59:37 UTC
Nevermind, Ryan wants to go over this code thoroughly.
Comment 9 Ryan C. Gordon 2009-12-15 22:37:32 UTC
Changing bug priorities...

--ryan.
Comment 10 Sam Lantinga 2013-05-21 00:52:51 UTC
Support for multiple mice has been removed for SDL 2.0