Create a Mouse Void
This is quite a long answer that I felt is better kept separate from my other one.
So that you understand where this solution came from, my monitor layout is as follows:
The two black area 1280x88 are off the screen but my mouse can still enter this due to an X bug. The workaround is a small program that prevents the mouse entering this void called XCreateMouseVoid.
Home Button Mouse Stopper
You can also use XCreateMouseVoid to create a small box that the mouse will stop against when pushed into the top left corner of the primary screen. This is what I have shown in green area of this image:
Installing
- Download XCreateMouseVoid and extract the files to your home folder
Open the folder in Terminal and run this command:
cd ~/XCreateMouseVoid && make
Test the program with values:
~/XCreateMouseVoid/XCreateMouseVoid 0 0 1280 88
Add to Startup Applications so its always runs upon bootup.
Calculate Values
The values required for XCreateMouseVoid are: x, y , w, h
- x & y refer to the start co-ordinates of the rectangle. These co-ordinates are based upon the whole desktop area and not individual monitors.
- w & h refer to the width and height of the rectangle
For my setup to stop the mouse entering the top and bottom black 1280 x 88 areas along with stopping it travel past the Home Button, I run two instances of the program with these values:
XCreateMouseVoid 0 0 1280 88
XCreateMouseVoid 0 1112 1280 88
Small Rectangle
If you have a different setup you can create the small rectangle as I mentioned earlier. The rectangle measures 60 x 25, which is the minimum width needed to properly stop the mouse.
The only value you need to change is x which is calculated by subtracting 60 from your secondary monitor's width. e.g. 1280 x 1024 monitor I subtract 60 from 1280 to get the value 1220 for XCreateMouseVoid:
XCreateMouseVoid 1220 0 60 25
Trapped Mouse Cursor
Occasionally the mouse cursor can jump into the created mouse void and become trapped. The solution is to press either the Super or Menu key so that a menu opens and frees the mouse cursor.