Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I have two monitors. One is 1920x1080 (the left screen), and the other is 1440x900 (the right screen). I am using Ubuntu 12.04.

Right now, I have it set up such that the tops of both monitors are aligned. That way, when I have my mouse at the very top of the left screen and I move my mouse to the right, it will move seamlessly to the right screen. However, if my mouse is on the bottom 180 pixels of the left screen and I move my mouse to the right, it won't move to the right screen, so I have to move my mouse up before I move it to the right because the right screen is smaller than the left screen.

My desired functionality: if I am at the bottom of the left screen and I move my mouse to the right, it should appear at the bottom of the right screen.


share|improve this question

2 Answers 2

The reason this is happening is due to the fact that your left monitor has a height of 1080 pixels, while the right screen has a height of 900. As the two are aligned at the top, your mouse will move smoothly if you move right to left and vice versa.

But this won't work for the bottom edge, since the bottom of the left screen has 180 pixels more height than the right screen. According to this question, it is a known bug in the X window system

The solution shown may work for you if you're using NVIDIA hardware and drivers, but otherwise you may be stuck. I don't have this issue running Windows 7 with different resolution dual monitors.

share|improve this answer
You have a correct assessment of the problem, but I don't think that the solution to the linked question helps. That problem talks about creating mouse voids to prevent the mouse from moving into spaces that are offscreen. My problem is that I want to move from screen to screen seamlessly on the bottom. Or did I miss something in those links? –  Sam King Jun 10 '12 at 5:09

I have knocked up something that seems to work on my machine. I have not managed to test it with multiple monitors, but I think the settings will work for you. It requires you to have installed xdotool.

If it works, put it in your .rclocal, as described here, and it will run on startup.

#! /bin/bash
# Cursor relocation script by Cass May <cass@cassm.net>

# definitions of "hot zone", which triggers cursor relocation

#target for cursor relocation

while true; do
    # grab cursor position, and extract x and y position
    CURSORPOSITION="$(xdotool getmouselocation)"
    XPOS="$(grep -o '[0-9]\+' <<< "$CURSORPOSITION" | awk 'NR==1{print $1}')"
    YPOS="$(grep -o '[0-9]\+' <<< "$CURSORPOSITION" | awk 'NR==2{print $1}')"

    # perform tests. If you wish to reconfigure this behaviour, and do
    # not know where to start, look up bash numerical comparison operators.
    if [[ "$XPOS" -eq "$XZONE" ]] && [[ "$YPOS" -ge "$YZONE" ]]
        xdotool mousemove "$XTARGET" "$YTARGET"
    sleep 0.1
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.