http://bugs.winehq.org/show_bug.cgi?id=12005
--- Comment #17 from John Klehm xixsimplicityxix@gmail.com 2008-04-22 19:18:52 --- Created an attachment (id=12402) --> (http://bugs.winehq.org/attachment.cgi?id=12402) Always check the first 2 system cursor slots
Ok possibly a bit more progress. I think the problem now is that gNumCursors is set to 1 for wizard pen as it has just device registered. Wacoms usually have 3 setup (cursor, stylus, eraser). So the bug is brought into play by our hack to support the older versions of photoshop that expect stylus to be in slot 1 in system cursors.
Heres the play by play:
1) We detect wizard pens 1 cursor (gNumCursors is 1) and put it in slot 0 of the system cursors (gSysCursor[]). 2) We run our hack for photoshop (Tablet_FixupCursors) and swap cursor.type == stylus into slot 1. 3) our event handlers call cursor_from_device which iterates through the system cursors slots looking for PHYSID == deviceid.
However cursor_from_device uses gNumCursors to be the non inclusive upper limit of the device slots. For wizard pens (and other devices with only 1 cursor) this means that: gNumCursors is 1 thus only gSysCursors[0] is checked. This is wrong becuase we swapped gSysCursor[0] to gSysCursor[1] in Tablet_FixupCursors earlier. With this patch we will always check slots 0 and 1 in order to accomodate our earlier accomodation for photoshop.