Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
17
rated 0 times [  17] [ 0]  / answers: 1 / hits: 146862  / 1 Year ago, sun, november 20, 2022, 10:39:29

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).


More From » 10.04

 Answers
4

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.


[#39538] Sunday, November 20, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ateact

Total Points: 176
Total Questions: 130
Total Answers: 122

Location: Egypt
Member since Sun, Apr 23, 2023
1 Year ago
;