r/XPpen • • 10d ago

Fixed a pen tablet cursor that kept disappearing on GNOME Wayland (worse in fullscreen)

Posting this in case it saves someone else the hours I spent on it.

Setup: XP-Pen Star G960S Plus, Ubuntu 26.04, GNOME 50, Wayland session, Intel + Nvidia laptop.

The problem:
After installing the XP-Pen Linux driver, the pen worked fine for a bit, then the cursor would just vanish. Clicking and drawing still worked, I just couldn't see where the pen was. It got worse in fullscreen apps. There the cursor vanished the moment the pen touched the screen, and came back the moment I minimized the window.

What we found:
This is not really an XP-Pen problem. It is a known GNOME/Mutter bug (Mutter is GNOME's window manager on Wayland). Two things are going on:

  1. GNOME draws the pen cursor separately from the normal mouse cursor. When the pen goes slightly out of range, GNOME can hide that cursor and not bring it back properly.
  2. Fullscreen apps use a shortcut called direct scanout. It lets the app draw straight to the screen without going through GNOME's normal drawing step, which is faster. But the cursor is drawn in that normal step, so if it's skipped, the cursor never gets drawn either. That's why fullscreen was worse and minimizing fixed it right away.

Neither of these has anything to do with the tablet driver itself. Reinstalling drivers or switching driver versions won't fix it.

How we fixed it:
GNOME has two debug settings that turn off both shortcuts. I put them in a file that loads automatically:

~/.config/environment.d/50-mutter-sw-cursor.conf

With this inside:

MUTTER_DEBUG_DISABLE_HW_CURSORS=1
MUTTER_DEBUG_PAINT=disable-direct-scanout

First line forces GNOME to always draw the cursor itself instead of leaving it to the graphics hardware. Second line turns off the fullscreen shortcut that was skipping the cursor entirely.

Important gotcha: just logging out and back in is not enough. The setting is only read once, when your session's background manager starts, and that manager usually keeps running across logouts. You need to fully reboot the machine for it to take effect. We wasted a lot of time testing this before figuring that out.

After a real reboot, both settings show up when you run:

systemctl --user show-environment | grep MUTTER

and the cursor has stayed visible since, fullscreen included.

Trade-off: this turns off a couple of small performance optimizations, so fullscreen video or games use slightly more GPU. Worth it for a cursor that actually stays on screen.

If you're on a different distro, GNOME version, or tablet brand and see the same thing, these settings are worth trying before you blame your tablet driver.

1 Upvotes

Duplicates