I am trying to hide the mouse pointer via:

(setq x-pointer-shape x-pointer-invisible)
(setq x-sensitive-text-pointer-shape x-pointer-invisible)
(setq void-text-area-pointer 'text)
(set-mouse-color (cdr (assoc 'mouse-color (frame-parameters))))

The last command is supposed to make the previous changes effective (it works with other pointer shapes), but in the case of x-pointer-invisible I get the error can't set cursor shape: BadValue.

Any ideas on how to fix this, or another way to make the mouse pointer invisible? I am looking for temporary invisibility that can be toggled on the fly.

  • The error is produces by x_set_mouse_color in src/xfns.c:1282 and is an error that is returned by the X server after the function XCreateFontCursor is called, so outside of emacs control. I suspect that you either are doing it wrong or you cannot use this method at all, but that's all I can say: I don't know how to do it right or whether another method exists. Some searching uncovered this but AFAICT the situation is far from satisfactory.
    – NickD
    Commented Jul 8, 2020 at 19:22
  • emacs.stackexchange.com/tags/elisp/info
    – Drew
    Commented Jul 8, 2020 at 19:56
  • A guess is that x-pointer-invisible isn't supported on your platform (or perhaps by Emacs?).
    – Drew
    Commented Jul 8, 2020 at 19:57
  • Thanks, @NickD and @Drew. For context, I have tried several x-pointer-* shapes and only x-pointer-invisible gives problems. I am on Linux/X11.
    – Stefano
    Commented Jul 8, 2020 at 20:05
  • Maybe google to see if x-pointer-invisible is supported on GNU Linux/X11?
    – Drew
    Commented Jul 8, 2020 at 20:07


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.