Disappearing pointer

Ubuntu Version:
Lubuntu 24.10 (fresh install)

Desktop Environment (if applicable):
LXQt

Problem Description:
Occasionally, my mouse pointer disappears. This is universally true across all applications. The desktop is still responsive to mouse input. If I can figure out where the pointer is on the screen, I can even use it. Thanks to a certain amount of feedback from UI elements (e.g. Firefox tabs), this kind of works, but it certainly doesn’t work for everything. I’ve never heard anything like this before and I have no similar problem on any other machine, although this is my only 24.10 install and the first time I’ve had anything other than macOS on this machine.

The events that cause it are a little unknown. Most days I have three things running: Firefox, NoMachine (for work) and Qterminal. It’s happened more than two times but the two times I remember was when interacting with two different webapps in Firefox: Apple Music (most recently) and Google Meet. So perhaps it’s Firefox specific? Or something to do with rather heavyweight webapps? I’m not sure about this because the last time it happened, Bandcamp was playing in a background tab but the current tab wasn’t a very resource intensive one.

I’ve tried almost everything I could find to do, including turning to duck.ai out of desperation. The only thing that fixes it is a reboot, but I just hate doing that. So I’m trying to figure out some more low level solution to my problem. In particular, I was thinking maybe there was some file in /sys I could modify or some parameter I could use with modprobe. Or maybe some way to “restart” the pointer or I guess the rendering thereof in X. At worst, removing the device from the device tree and starting again.

Relevant System Information:

  • probably not relevant, but:
    iMac11,2 1.0, Intel i3 540 (4) @ 3.059GHz, AMD ATI Mobility Radeon HD 4670

  • what’s not relevant: the mouse. I’ve tried many.

Screenshots or Error Messages:

  • I searched journalctl pretty darn closely, like line by line, and didn’t find anything. Nothing in Xorg.0.log, either.
  • xlsatoms | grep CURSOR does indeed return something.

What I’ve Tried:

  1. Logout and back in
  2. Restart display manager (basically duplicates 1 anyways)
  3. Restarting the compositor (this happens on restart anyways)
  4. Change the pointer style (LXQt requires a session restart, so this is basically a duplicate of 1,2)
  5. Switch to VT and back
  6. Switch to VT and then stop the display manager and start it up again, effectively restarting X.
  7. Unplug and replug the USB receiver
  8. Turn the wireless (note this is Logitech’s proprietary protocol) mouse on and off
  9. Use a wired mouse
  10. Use a Bluetooth mouse
  11. Toggling hardware acceleration in Firefox. Makes no difference either way.
  12. Cursor stuff:
    1. xsetroot -cursor_name left_ptr to force a cursor redraw
    2. echo 'Xcursor.theme: default' >> ~/.Xresources && xrdb -merge ~/.Xresources to make sure the cursor theme is properly set
    3. export XLIB_SKIP_ARGB_VISUALS=1 in ~/.xinitrc to force a hardware cursor
  13. Xorg stuff:
    Section "InputClass"
       Identifier "mouse"
       MatchIsPointer "yes"
       Option "AccelerationProfile" "-1"
       Option "AccelerationScheme" "none"
    EndSection
    
  14. Use xinput disable "Virtual core pointer" in an attempt to turn off all the pointing input in X. The plan was to then reenable it. Unfortunately: X Error of failed request: BadAccess (attempt to access private resource denied).
  15. Use unclutter to hide the pointer, hoping it will reappear on movement
  16. Use setxkbpmap -option grab:break_actions; xdotool key XF86Ungrab. Probably pointless (hah!), as I can still move the pointer, but trying to ensure nothing else is trying to grab the input (like virtual machines often do).
  17. Restart udev
  18. Try to restart the usbhid module. Wouldn’t work because it was in use, even with all USB devices unplugged, including turning Bluetooth off via turning off the btusb module (the name indicates that Bluetooth is implemented through USB)
  19. Use NoMachine to remotely control the machine with another device with a working pointer. This does work, but only on the remote machine and that’s because NoMachine has the ability to show both the local and remote pointer. So I was seeing was the local one. No remote one.

Things to try in the future

  1. I really think the issue has to do with the rendering of the pointer and not the actual hardware, but that may be something to try. libinput-tools and some lesser known options in xinput could prove useful.
  2. Learn the ins and outs of X internals and debug the actual problem.
  3. Maybe I should just make the assumption that it’s X and file a bug against it.
  4. I’ve been meaning to look into better video driver support for other reasons. I’ve seen some other reports about of people suggesting their similar experience (not necessarily all the same set of conditions, per se) had to do with the driver.

Notes
FWIW I just noticed my Compose key isn’t working. I have ~/.XCompose set up so it should be. I feel like I remember using it earlier today. I wonder if this isn’t somehow an X issue. Still, though, it’s not like all input is a problem. I have no issues with the keyboard beyond that, including the cursor. Since posting this originally, it’s happened one other time and that time the Compose key was working, so that may have been a fluke.



P.S. this post would not be possible without the wonderful Vimium for Firefox (which can do almost anything a mouse could do, but with a keyboard) and keynav. Oh, and the mighty tmux, too, in terminal. It would be so much harder to copy and paste without it!

1 Like
  1. First, the fact that the Compose key isn’t working alongside the pointer issue strongly suggests an X11 compositor or window manager problem rather than a hardware or driver issue. This is supported by:
    • The pointer still works functionally
    • Different mice (wired, wireless, Bluetooth) all exhibit the same issue
    • NoMachine can show its own cursor but not fix the local one

Here are some targeted solutions to try, in order of least to most disruptive:

# 1. First, try to force a cursor redraw through X
xsetroot -cursor_name left_ptr

# 2. If that doesn't work, try resetting the compositor
killall picom    # if picom is running
# or
killall compton  # if using compton

# 3. Check if the X cursor theme is properly set
echo 'Xcursor.theme: default' >> ~/.Xresources
xrdb -merge ~/.Xresources

# 4. Restart the X input system without full restart
sudo systemctl restart display-manager

# 5. Check for and kill any stuck Firefox GPU processes
ps aux | grep firefox
kill -9 [relevant-pid]

I would also recommend adding these diagnostic steps for the next time it occurs, or if you can manually trigger it:

# Check X errors when it happens
cat ~/.local/share/xorg/Xorg.0.log | grep EE

# Monitor X events in real-time
xwininfo -root -tree

# Check if the cursor resources are still loaded
xlsatoms | grep CURSOR

For a more permanent solution:

  1. Edit /etc/X11/xorg.conf.d/50-mouse.conf (create if it doesn’t exist):
Section "InputClass"
    Identifier "mouse"
    MatchIsPointer "yes"
    Option "AccelerationProfile" "-1"
    Option "AccelerationScheme" "none"
EndSection
  1. Since you’re using an AMD Radeon HD 4670, you might want to check which driver is in use:
# Check current driver
lspci -k | grep -A 2 -i "VGA"

# Install if needed (likely not)
sudo apt install xserver-xorg-video-radeon
  1. Consider adding this to ~/.xinitrc or similar startup location:
# Force hardware cursor
export XLIB_SKIP_ARGB_VISUALS=1

Lastly, I’d suggest monitoring Firefox’s GPU process usage when using heavy web apps like Google Meet and Apple Music. You might want to try:

  1. Disabling hardware acceleration in Firefox temporarily to see if it resolves the issue
  2. Using about:support in Firefox to check if there are any graphics-related warnings
  3. Running Firefox with MOZ_X11_EGL=1 firefox to force EGL instead of GLX
5 Likes

I knew someone would have some good suggestions here! I’m not surprised it’s you! Thanks so much for this treasure trove of good information.

Some initial thoughts and questions:

  • I don’t think it’s the compositor or window manager. Logging out/restarting the display manager should have the same effect.
  • Regarding looking for stuck processes, I assume we’re looking for D, X, Z and maybe long running S states?
  • Why didn’t I check the X log! Ugh I know better! Nothing came of it, but I’m adding that above.
  • About the X conf, how does disabling acceleration help?
  • I hadn’t encountered XLIB_SKIP_ARGB_VISUALS before but it seems that the issue here is how particular apps deal with compositing? If that’s the case, how would the problem persist despite compositing being restarted (see above) and across all applications?
  • You’re right, I already have xserver-xorg-video-radeon. I was thinking about trying the proprietary one. I hate to say it, but on my laptop I have the Nvidia driver and I find it performs a lot better than Nouveau.
  • Just to be clear, this setting in Firefox shows hardware acceleration on. To turn it off, I can uncheck the lower checkbox. Does checking the upper one also have the same effect, or is that not guaranteed?
    image
1 Like

Checking the upper checkbox hides and resets the lower checkbox to checked. Disabling hardware acceleration in Firefox requires specifically unchecking both checkboxes.

1 Like

What’s the point of the upper one then?

There used to be more performance settings hidden behind that checkbox (e.g. number of content processes). Checking “Use recommended performance settings” would also reset those other settings to default. Looking at the relevant Firefox source code, looks like it still does reset the number of content processes setting even though there is no UI for that one anymore.

1 Like

Sounds a lot like this.

2 Likes

Following the paper trail, it seems the ultimate suggested solution is to use the software cursor:

Section "Device"
   Identifier "device1"
   Option "SWcursor"
EndSection

Comments suggest it’s ugly and may not work. Barring all of Alan’s wonderful suggestions, I might give that a go. Thanks!

For anyone reading this in the future: go to a virtual terminal (e.g. CtrlAltF3) and login. Then, stop the display manager with sudo systemctl stop display-manager. Then start it back up with sudo systemctl start display-manager. This will get you back to your typical login screen. Don’t do that inside of X because it does not actually kill X.

It happened again while in Apple Music. That may be the culprit here although I don’t think it was open the first time I remember— that was in Google Meet. Today I was in Google Meet and no issues.

I updated everything above. Nothing helped. I probably should have done the X config changes and then done the restart of X, but I didn’t. Next time.

Only things to kind of wonder about are the following errors in about:support in Firefox, but I’m not even sure they aren’t old:

@humpty’s the winner on this one. Despite all of @popey’s wonderful suggestions, the so-called ugly one worked. And it restored the pointer to the way it was. Not ugly at all. Thanks everyone for the help!

1 Like

A post was split to a new topic: Pointer turns into a black box when unlocking

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.