Disappearing mouse pointer in Xubuntu

Posted: May 25, 2016 in Linux, Ubuntu
Tags: , , , , , ,

After all these years, my Acer 5740 laptop is still running linuxghost-mouse-25992, specifically Xubuntu, the xfce based Ubuntu derivative.  For the most part it remains serviceable, but some annoying bugs have come to light from time to time. I suspect these are at least in part due to the old hardware combined with a new(ish) kernel and drivers.

Case in point: log into Xubuntu 16.04 after the screen has been locked (by suspend or logout) and the mouse pointer becomes invisible. The mouse still works though, and if you manage to position the invisible pointer just right you  can point and click as usual. This bug seems to be related to the combination of lightdm, light-locker  and the xorg-video-intel driver configured to use sna acceleration.  The sad fact is that this bug has been around for a long time (at least since 15.04, probably longer). It seems I am not alone with this bug on my old hardware: reports suggest it affects more recent hardware as well.

The good news is that there are several potential  workarounds. The best one, found here involves  switching to a new VT and then back by pressing  ctrl-alt-F1 immediately followed by ctrl-alt-F7 or by placing commands to do the same in a bash script and assigning it a keyboard shortcut. But how do we automate this so that no keypresses are needed?

First, create the script VTswitch with these contents:

/bin/chvt 1
/bin/chvt 7
sleep 1

Save it in the location of your choice and make it executable.

Next, if it doesn’t already exist, create the file 50-myconfig.conf  in the directory /etc/lightdm/lightdm.conf.d with these contents:


Finally, restart lightdm:

sudo systemctl restart lightdm

That’s it!  Next time you unlock the screen, your mouse cursor will be visible with no extra keystrokes.  Please let me know if you see any weird side effects or  if you come across a patch that resolves this bug.

UPDATE: Even better than the workaround above, at least with my hardware, you can just avoid the bug entirely by removing the xorg-video-intel driver and using the modesetting driver built into Xorg instead:

sudo apt-get remove xserver-xorg-video-intel

If you were using the workaround, remove the file 50-myconfig.conf in  /etc/lightdm/lightdm.conf.d

Finally, reboot!

  1. Jarno Suni says:

    [SeatDefaults] is obsolete, so it is better to use [Seat:*] instead. (Source: https://wiki.ubuntu.com/LightDM) The bug is not restricted to Intel Core i3 variants.

  2. Great, thanks for figuring this out! FYI under Xubuntu, adding it to /etc/lightdm/lightdm.conf.d/20-fix-mouse-cursor.conf also works and does not get replaced by package upgrades.

  3. Btw, this bug also happens on my 2014 MacBookAir and 2015 Chromebook Pixel.

  4. k says:

    For those who have multiple users on their machines:

    n=$(fgconsole) || exit 1
    case “$n” in
    /bin/chvt 1
    /bin/chvt “$n”
    sleep 1
    *) echo “error from $0; fgconsole gave $n” >/tmp/VTswitch.log

    # based on http://stackoverflow.com/questions/3034567/how-do-i-find-the-current-virtual-terminal (a strangely recurring situation!)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s