http://bugs.winehq.org/show_bug.cgi?id=6971
--- Comment #63 from Joe McKort mortsmota@fastmail.fm 2008-03-10 14:38:38 --- Created an attachment (id=11303) --> (http://bugs.winehq.org/attachment.cgi?id=11303) Hack to force warping when mouse leaves box
i suffered from this bug using gothic 3, i.e. i couldn't turn around freely because the mouse stops when it hits the borders. i started out with the "Hack to force mouse warping", but using the main menu is a pain this way ;-) (probably same problem as Roman Mamedov described commenting his patch) but i don't want to press a button to look around, so none of those patches worked for me, therefore i started experimenting with the mouse.c until i came up with a solution that's unideal, but might at least work for a couple of games. what it does is warping the mouse in case it leaves a box that is 2 pixels (can of course be changed) smaller than the screen on each side, using hook->pt.{x/y} to get the current mouse position and This->win_center{X/Y} for calculating the screen size. the latter one could probably be replaced by adding a new variable, which stores the screen size, so it won't have to be computed anew.
the main two problems about this solution are: the mouse will also warp, when in a menu leaving the box and when playing in window mode the mouse might leave the window before the hack "realizes" this, that means the window manager regains control over the mouse handling before the mouse is warped back to the center, f.e. if you move the mouse too fast.
but i hope it will help someone!