4

Some applications display their own mouse pointers but they fail to hide the GNOME mouse pointer correctly. I'm trying to find a workaround higher in the system (in GNOME or X). Any ideas?

What doesn't help:

  • suggesting to fix the application in the first place
  • disabling mouse with xinput - I obviously want to use the mouse
  • using unclutter - doesn't work when I use the mouse
  • switching org.gnome.settings-daemon.plugins.coursor - plugin doesn't exist any more

I currently run Ubuntu GNOME 15.10 with GNOME 3.18.0 but the more generic solution, the better.

cprn
  • 1,209

2 Answers2

2

Still happy to accept a better answer!

What happens to work for my current issue - which is Unturned (free game on Steam):

Create a file named blank containing cursor and mask data (white space matters):

#define blank_width 1
#define blank_height 1
#define blank_x_hot 0
#define blank_y_hot 0
static unsigned char blank_bits[] = { 
    0x00 };

Load it with:

xsetroot -cursor blank blank

When finished, you can load the default cursor with:

xsetroot -cursor_name left_ptr
cprn
  • 1,209
1

I've found an alternative after six years.

Searching around the internet brought me to this AUR package: https://aur.archlinux.org/packages/xcursor-transparent-theme/

From there, the package build leads to sources over at http://downloads.yoctoproject.org/releases/matchbox/utils/xcursor-transparent-theme-0.1.1.tar.gz . This contains a completely transparent set of xcursors. After installing these with

./configure; make; make install

For Ubuntu 22.04, you may need to link the resulting folder to /usr/share/icons/ with the following command

ln -s /usr/local/share/icons/xcursor-transparent /usr/share/icons/

The cursor became visible in my cursor theme selection in Gnome Tweaks.

From here, I can now change the cursor theme via the command line:

gsettings set org.gnome.desktop.interface cursor-theme xcursor-transparent

For reverting it, I can instead use Pop as the cursor theme, as I am on Pop OS. You'd likely use DMZ-White if you are on Ubuntu.

I used the keyboard shortcuts to bind Super+F10 and Super+F11 to set the cursor theme to either one, effectively toggling the cursor on and off when required. From here, you could probably find out a way to have these commands run whenever you focus/unfocus the window that you want your mouse to be (in)visible on.