Mouse not warping properly in full screen mode

Raf Geens rafgeens at
Sun Feb 18 16:03:58 CST 2007


I'm new to Wine and DirectX development, but I've dug around a bit in
the Wine source code to get Determinance, a sword-fighting game to
work. I've submitted an entry for it to the application database.

The main problem I had was with strange mouse behaviour in full screen
mode. The player can rotate his character by holding down the right
mouse button and moving the mouse. In Windows, this allows you to turn
as much as you want. In Wine, the rotation stops at a certain point.
You can't see the cursor, but I'm fairly certain the point at which
movement stops is when the cursor hits the edge of the screen.

When this has happened and you return to the main menu, it can occur
that for example the cursor can't reach the top part of the screen
anymore. It's as if an invisible rectangle that keeps the cursor
inside the screen has moved. In such a case, moving the cursor all the
way to the bottom and back up again restores normal behaviour.

I've isolated the problem to the following line in dlls/dinput/mouse.c :

This->need_warp = (pt.x || pt.y) && dwCoop & DISCL_EXCLUSIVE;

Changing it to This->need_warp = TRUE; as a quick test makes the mouse
behave correctly.

I've read about the mouse warping hack over here: . Inserting a
TRACE statement displaying the variables in that line of code revealed

- it is only executed in full screen mode, and not in windowed mode
- dwCoop is DISCL_NOWINKEY , causing the expression to evaluate to false.

So it seems the DISCL_EXCLUSIVE constraint is too restrictive. Reading
about the meanings of the dwCoop values at msdn ( ), I'm guessing the Determinance developers
might not have entirely been following the rules. However, it works
properly on Windows. Would it be acceptable to drop the

Raf Geens

More information about the wine-devel mailing list