35

For some reason, the mouse pointer on my Ubuntu 10.04 PC disappears after the computer is woken up from suspend. That PC is missing a keyboard, so I can fix this by logging via ssh, and issuing:

sudo service gdm restart

... however, this basically restarts gnome, and will close any applications that may have been running.

Another way to solve this is to set up that PC as a synergy slave - and then move the mouse from the synergy master to the slave desktop; this brings the mouse pointer back.

Is it possible to run some command, such that I don't need to restart X (or gdm) but I'll effectively restart the mouse pointer code? Then I could put this into a script on the desktop, and be able to recover the mouse pointer after suspend without needing a second machine (even with the mouse pointer invisible, mouseovers on icons are still rendered, so I could target this icon).

11 Answers 11

40

this may fix the problem.

If you are stuck with no mouse movement on your laptop (touchpad) then press the key combinations Alt+F2 and type in

gksudo modprobe -r psmouse

Type in the password, press enter, and then press Alt+F2 again for entering the following

gksudo modprobe psmouse

Thats it. Your mouse pointer will start working again.

If you like to do it through the terminal, then type in gnome-terminal after pressing Alt+F2 When the terminal open up type the following

sudo modprobe -r psmouse

or

sudo modprobe psmouse

If your usb mouse is getting stuck, then use the following command after pressing Alt+F2

gksudo /etc/init.d/hotplug restart
| improve this answer | |
  • Hi @BlueXrider - many thanks for your answer! That PC "is missing a keyboard", so I cannot press Alt-F2 :) However, I tried the sudo modprobe psmouse via ssh, and that unfortunately does not show the mouse pointer after suspend wake (apparently, this is gnome bug, not mouse driver bug). Ubuntu 10.04 also complains: "sudo: /etc/init.d/hotplug: command not found"... Cheers! – sdaau Apr 2 '12 at 6:42
21

I am using Xubuntu 16.04. The suggestion posted in this answer by Ulad Kasach worked for me.

Bring the cursor back with Ctrl+Alt+F1 followed by Ctrl+Alt+F7

| improve this answer | |
  • Why does this work? Can anyone kindly explain? – echo_salik Nov 1 '17 at 3:50
17

Finally, found a solution for this:

From #696855 - How do you hide the mouse pointer under Linux/X11? - Stack Overflow; I heard about unclutter, so just ran

sudo apt-get install unclutter

And then put the following in a script on the desktop, called, say unclutter.sh:

unclutter -idle 1 -root -grab -visible

... and make sure you've done chmod +x unclutter.sh.

Then, after the mouse pointer disappears after suspend, use mouseover of icons to target the script and run it; this will start unclutter, which will simply hide (the already invisible) mouse pointer after 1 second of mouse inactivity; but then when you move the mouse after that, finally the mouse pointer will show :) ... however note that to stop unclutter after that, you'd have to do from terminal:

sudo killall unclutter

... as unclutter would be, at that point, running in the background.


Note: also tried, via #15 / Bug #337926 “vino: mouse cursor stays in upper left corner” : Bugs : “vino” package : Ubuntu, to use:

xdotool mousemove 100 100

but this does not make the mouse pointer show again.

Btw, one can look in the synergy source, WebSVN - synergy - /trunk/, and the "reset" of the mouse pointer seems to be coded in ./lib/platform/CXWindowsScreen.cpp.

| improve this answer | |
  • Thank you! I am having this recurrent problem with Fedora LXDE, and you have saved me from restarting. – Davidmh Dec 10 '15 at 8:32
  • This works on chromebooks when you lose the cursor switching into/out of X framebuffers (crouton). Thanks so much! – dwks Jun 15 '16 at 7:52
  • I guess their syntax changed a bit unclutter -idle 1 -root -grab -visible worked for me. – Seppo Erviälä Jun 25 '16 at 12:10
3

This answer from It's F.O.S.S. worked for me once.

gsettings set org.gnome.settings-daemon.plugins.cursor active false

The second time, it did not work, and neither did any of the above suggestions. So after these, I just closed the lid of my laptop to suspend it, reopened it, and the pointer was back.

| improve this answer | |
3

Had that problem the other day. I switched to another terminal (Ctrl+Alt+F1) and then came back to the current window (Ctrl+Alt+F7). It did the trick for me.

| improve this answer | |
2

Had this issue with my laptop's touchpad mouse missing. Using your keyboard for navigation, open launcher (windows key) and type "mouse". In the modal that pops up, check if Touchpad section is in the "ON" position.

| improve this answer | |
  • Entering the "Mouse and Touchpad" setting also solves the missing mouse pointer issue in Debian 8 Gnome 3.14.1 – Paul Rougieux Apr 28 '16 at 7:21
0

It is also worth to check battery of your mouse if it is a wireless one, the battery may just went flat with such effect of unmoving cursor.

| improve this answer | |
0

I've tried many things, including restarting the GNOME shell, suspending, and executing

gsettings set org.gnome.settings-daemon.plugins.cursor active false
gsettings set org.gnome.settings-daemon.plugins.cursor active true
dconf write /org/gnome/settings-daemon/peripherals/touchpad/tochpad-enabled false
dconf write /org/gnome/settings-daemon/peripherals/touchpad/tochpad-enabled true
dconf write /org/gnome/settings-daemon/plugins/cursor/active false
dconf write /org/gnome/settings-daemon/plugins/cursor/active true

What finally helped me was to restart the gsd via gnome-settings-daemon --replace.

| improve this answer | |
  • gnome-settings-daemon --replace was this supposed to trigger something like a reboot? Like close all your windows and prompt you for another login? – skytreader Mar 2 '16 at 18:41
  • Mint 18 doesn't seem to have this option. – not2qubit Dec 9 '16 at 14:11
0

Restart the touchpad. One way using xinput.

  1. Find touchpad device id using xinput --list
  2. Stop touchpad: xinput disable id_found_in_step_1
  3. Start touchpad: xinput enable id_found_in_step_1

This just worked for me now on Ubuntu 18.04!

| improve this answer | |
0

If you are using gnome, this worked for me. Run the command below and note your touch pad id. For example, mine is 12 labelled id=12

xinput --list

Run

xinput set-prop 12 "Device Enabled" 0

To disable your touchpad.

Then run

xinput set-prop 12 "Device Enabled" 1

To enable it again.

Refresh xorg by holding down command + r. Type r and click enter key.

| improve this answer | |
-1

If you are using a USB mouse, and are on location with the computer in question, then the first thing you should try is to unplug the mouse for a moment and then plug it back in.

Works for me every time.

I hibernate my computer each night and very occasionally upon awakening, the mouse pointer is missing but my USB keyboard works.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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