Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to fix this problem i have with my mouse when playing games and i don't know how to apply this patch.

Any help would be nice. Thanks.

share|improve this question

You could try out this PPA, which provides you with cutting-edge Xorg builds and related packages. To add:

sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get dist-upgrade

Also make sure you install this tool, which will allow you to revert the changes made by the PPA:

sudo apt-get install ppa-purge

Then reboot your computer.

Note that this PPA has a profound impact on vital system components. If something goes wrong, you might end up in graphical safe mode, or even worse, in a recovery console.

To undo the changes, run:

sudo ppa-purge xorg-edgers
share|improve this answer

To apply a patch you will need a version control system to obtain the original source code, then you will need to find the branch with the changed source code and you will have to merge them. You can also merge them by hand (direct copy-paste of code segments in your copy of the whole source code). This would be easier for you to do.

After that you will have to install a compiler (in your case) and build x11. Then you will need to reinstall it using the newly generated binary. As you see, this is a complex procedure that will also need to be redone once the main source tree gets updated (if you want updates ofcourse).

All in all, either try the unstable PPA suggested above, or downgrade to ubuntu 11.10 Your problem showed in Ubuntu 12.04's version of X11 (more specifically XInput) X11 is a very important component for your OS and medling with it is not a good idea. You have been warned. If you really need to do that read on.

These are the steps (in commands) needed to patch something. They are not direct one to one answer to your question.

Let's say X11 uses the git VCS First we need to install git

sudo apt-get install git git-core

Then we need to install the compiler

sudo apt-get install build-essential

Then we need to obtain the source tree (supposing git.freedesktop.x11.git exists)

git clone git.freedesktop.x11.git

This might take a while so play some non wine games until it finishes Once it finishes goto x11 directory

cd x11

Run :


This script will complain if something is missing. Install that package / those packages using synaptic or sudo apt-get package-name Now run (numberOfCores is the number of cores in your processor):

make -j(numberOfCores * 2)

This might also take a while. Once it finishes run :

sudo make install

Now you have a custom build of x11 installed. Now that we are sure that everything wen fine we can patch it. There are a few ways to do that: First : git pull guyWhoFixed11 x11fixed && git merge x11fixed master && make && sudo make install Second : Find the file that needs fixing (X11Mouse.c for example) and replace the grab_mouse function contents with contents from your link. Then : make && sudo make install

As I said,this is just a general procedure for patching and does not apply 100% directly to your question.

git am --signoff < x11fixed.patch 

might also work for the patching part.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.