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,219

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,219
  • 2
    It isn't perfect by far. It just happens to work with Unturned in full screen but cursor still shows in other non-root windows (e.g. terminal, browser, etc. - it actually is perfect for this single case where I often do switch to these applications during gameplay but it's not good for more general purpose). – cprn Oct 07 '15 at 11:15
  • not working for me – Barbz_YHOOL Aug 20 '20 at 22:07
  • Yeah, after 5 years it might. It's a low level solution that works directly with Xserver. Probably still doable on Wayland, try the man pages. – cprn Aug 21 '20 at 17:31
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.

  • Marking as answer because it's more current - I didn't actually test it. – cprn Aug 11 '21 at 23:40
  • In my case, on ubuntu 22.04, after sudo make install, I need to create link at /usr/share/icons/ with sudo ln -s /usr/local/share/icons/xcursor-transparent /usr/share/icons/ before changing the cursor-theme – Afriza N. Arief Jan 19 '24 at 03:22