dinput & [Get|Set]CursorPos conandrum

Vitaliy Margolen wine-devel at kievinfo.com
Sat Aug 5 23:18:14 CDT 2006


Some one few weeks ago mentioned that they needed SetCursorPos to work globally
(between processes). Well it seems after all we do need that to fix few lots of
things, including most mouse related bugs in dinput.

Actually the problem I have is not as much with SetCursorPos as with the fact
that with multiple processes only one gets MotionNotify (and other notify)
events. This gets cursor position out of sync between two processes and causes
interesting side-effects. It's not something major but an annoyance. There are
could be more serious problems however.

The possible solutions might be:
1. Store cursor_pos in wineserver and call wineserver whenever we need it or
   need to modify it. Seems straight forward but how expensive it would be?
2. Use shared memory. That means we have to allocate it first (will
   SharedUserData work for this?). And use mutex for sync.
3. Query X for it's cursor position. Pretty much what we do, except that needs
   to be fixed:

Current dinput has lots of problems with lots of games for number of different
reasons (and I'm talking about just mouse). To fix some(all) of them we need to
move managing of mouse warping to x11drv - only it has enough information about
what programs doing to the cursor. And to make it work all we really need is to
make GetCursorPos returned cached cursor position and not the latest from X.

Any ideas appreciated.

Vitaliy




More information about the wine-devel mailing list