Bug 6971

Mouse "escapes" windows or is confined to an area in full screen programs

This bug was fixed in wine-1.3.21. A related bug ( http://bugs.winehq.org/show_bug.cgi?id=27028 ) was fixed in wine-1.3.33 and fixed again harder in wine-1.3.36.

See also

In several games, the mouse is broken. The problem is with X11: many games want relative mouse movements (how far has the cursor moved), not absolute mouse movements (where it is exactly), but X11 doesn't provide a way to get this information.

Wine has to fake relative mouse motion by tracking the absolute position, and working out how far the cursor has moved. This doesn't work properly when the cursor is not over any window created by Wine (X11 doesn't send any more movement notifications), or when the cursor is at the edge of the screen (the absolute position isn't changing even though the mouse is moving). To "fix" the latter problem, Wine can use mouse warping: the mouse cursor is constantly moved to the middle of the screen. This has severe problems as well (can't use game menus since cursor is stuck in the middle of the screen).

However, the new XInput2 X11 extension (which is part of XOrg 7.5) provides relative mouse motion events. Once this extension is more common, we will be able to fix Wine properly.

The reason for this page

The bug is kinda famous, and was being spammed continuously with half-broken patches (i.e hacks), "me too" comments ("game x also/still doesn't work" and "patch x still applies"), questions about how to apply patches / compile Wine (use the Wine support forum for that), flames, etc.

It has over 300 comments, and over 100 users on the CC list.

This wikipage exists to put patches and hacks on so players can enjoy their games again till xinput2 is out or the Wine developers fixed the bug.


(read carefully!!)

The problem is that it's a hack and that it also breaks things. 

People reporting bugs with this thing switched on waste a lot of valuable time. Then
every week, or at the moment every day someone posting that the hack does, or
doesn't work doesn't help. This is just some additional useless information in
this bug and it's also useless for the devs entering their mailbox. About 90%
of the last part of this page is spam and this bug is really hard to read like
it is. This is bugzilla, not a forum.

This is not something you do in a few days. It requires a lot of work.
It also BREAKS things, which means it doesn't belong here. Some people will
just apply the patch, see things are broken, and report bugs with their broken
wine versions. Or they'll just post information about the hacks, which isn't
what the bug report is about.

What someone SHOULD do is create a wiki page, post their hack there and write a
clear disclaimer at the top of the wiki page and everywhere near a download
link, because some people really do their best to miss every warning. 

Now if the patch is broken for a certain version of wine, one could edit the wiki
page, and tell it's broken, so everyone who's interested knows it's broken.
Then they can wait for someone to fix the hack for the newer version.

This would mean no more spam here, no more useless hacks here, and a clear
disclaimer that this hack will break things. Then everyone who wants a hack can
get their hack, and everyone who only cares about the actual bug and about
REALLY fixing it can come here.

I want to clarify some point

The Patch i submitted is for use with FULL SCREEN i could not manage to
get it work in windowed mode

In Full Scrren it breaks some games but till now the mosat important i
found was spellforce.

I suggest you keep an original copy ow wine and use the pathed version
for what it is done for

I developed it for Unreal 3 Engine Games, Unreal 2 Engine Games and
Unreal Engine Games

I personally do not think that some 100hrs of code are a Hack
But if you do not want it i simply will no more publish my patches
You said it yourself - if it doesn't cover all cases/fixes only one game - it's
a hack.

He said that it covers three Unreal Engine generations, and that's basically
what's being affected by this bug. Of course, if it doesn't work in windowed
mode, it is a hack, but it's still better than nothing.

How to apply a patch

Install the dependencies for Wine - see Recommended_Packages for 32-bit and WineOn64bit for 64-bit.

Download the Wine source code, patch it, build it, and create a .deb package:

wget http://downloads.sourceforge.net/project/wine/Source/wine-1.1.34.tar.bz2
tar xjvf wine-1.1.34.tar.bz2
cd wine-1.1.34
wget http://bugs.winehq.org/attachment.cgi?id=25097 -O mousewarp-1.1.34.patch
### Download other patches you may want at this point ###
patch -p1 < mousewarp-1.1.34.patch
make depend
make -j 2
checkinstall -D --install=no


This patch works for the following games and the following wine versions (please add more games which work with this patch and the Wine version if known):


Wine version:


- Borderlands 1.2

1134, 1135, 1136, 1137,1138,1139,1140,1141


- Star Wars: KotOR (Steam)



- Runes of Magic

1139, 1140


another game but still same patch ...

Patch: Patch_id_1.patch

Game-specific notes

Mass Effect 2

The appdb entry for Mass Effect 2 says that the tiny patch http://bugs2.winehq.org/attachment.cgi?id=15638 plus winetricks mwo=force suffices. Note that ME2 doesn't have sound unless launched in a virtual desktop without the launcher (see bug 23150), and unfortunately, this patch doesn't work especially well when the mouse can leave the window. You might need to use a virtual desktop of the same size as your real desktop for best results.


Bug6971 (last edited 2012-07-16 22:49:21 by KyleAuble)