unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: invisible mouse pointer?
Date: Wed, 03 Dec 2008 10:58:02 -0800	[thread overview]
Message-ID: <m3y6yxrsqt.fsf@fitzsim.org> (raw)
In-Reply-To: <001701c9556c$9e613750$c2b22382@us.oracle.com> (Drew Adams's message of "Wed, 3 Dec 2008 09:28:55 -0800")

[-- Attachment #1: Type: text/plain, Size: 715 bytes --]

Hi Drew,

"Drew Adams" <drew.adams@oracle.com> writes:

> Is it possible to make the mouse pointer invisible (disappear)?
>
> I don't mean by, say, setting its color to the frame's background color on all
> characters of a buffer's text. I mean by, say, setting `x-pointer-shape' to a
> value (e.g. nil?) that (somehow) causes the pointer to disappear.
>
> I couldn't find anything about this, but it could be useful. Is there a good
> workaround, if the feature doesn't exist?

I also looked into this a while ago and couldn't find a way to
completely hide the pointer, so I wrote the attached patch.  Ideally
this low-level functionality would be exposed through a new mouse
avoidance mode, as you suggest.

Tom


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: emacs-hide-cursor.patch --]
[-- Type: text/x-patch, Size: 1572 bytes --]

Index: src/xfns.c
===================================================================
RCS file: /sources/emacs/emacs/src/xfns.c,v
retrieving revision 1.726
diff -u -r1.726 xfns.c
--- src/xfns.c	31 Jul 2008 05:33:55 -0000	1.726
+++ src/xfns.c	3 Dec 2008 18:51:28 -0000
@@ -67,6 +67,7 @@
 #endif
 
 #ifdef USE_X_TOOLKIT
+#include <X11/extensions/Xfixes.h>
 #include <X11/Shell.h>
 
 #ifndef USE_MOTIF
@@ -5258,6 +5259,35 @@
 
 \f
 /***********************************************************************
+			Cursor visibility
+ ***********************************************************************/
+
+DEFUN ("x-show-pointer", Fx_show_pointer,
+       Sx_show_pointer,
+       0, 0, 0,
+       doc: /* Show the mouse pointer.  */)
+     ()
+{
+  FRAME_PTR f = SELECTED_FRAME ();
+  XFixesShowCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
+  return Qt;
+}
+
+
+DEFUN ("x-hide-pointer", Fx_hide_pointer,
+       Sx_hide_pointer,
+       0, 0, 0,
+       doc: /* Hide the mouse pointer.  */)
+     ()
+{
+  FRAME_PTR f = SELECTED_FRAME ();
+  XFixesHideCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
+  return Qt;
+}
+
+
+\f
+/***********************************************************************
 			File selection dialog
  ***********************************************************************/
 
@@ -5963,6 +5993,9 @@
   last_show_tip_args = Qnil;
   staticpro (&last_show_tip_args);
 
+  defsubr (&Sx_show_pointer);
+  defsubr (&Sx_hide_pointer);
+
   defsubr (&Sx_uses_old_gtk_dialog);
 #if defined (USE_MOTIF) || defined (USE_GTK)
   defsubr (&Sx_file_dialog);

  parent reply	other threads:[~2008-12-03 18:58 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-03 17:28 invisible mouse pointer? Drew Adams
2008-12-03 17:46 ` Thierry Volpiatto
2008-12-03 17:58   ` Drew Adams
2008-12-03 19:28     ` Jan Djärv
2008-12-03 19:52       ` Drew Adams
2008-12-03 20:06     ` Stephen J. Turnbull
2008-12-03 18:58 ` Thomas Fitzsimmons [this message]
2008-12-03 19:14   ` Drew Adams
2009-07-03 11:50   ` Jan Djärv
2009-07-03 14:39     ` Jan Djärv
2009-07-03 15:34     ` Eli Zaretskii
2009-07-03 15:40       ` Eli Zaretskii
2009-07-03 17:26         ` Jan Djärv
2009-07-03 17:41           ` Lennart Borgman
2009-07-03 18:30             ` Jan D.
2009-07-03 18:33               ` Lennart Borgman
2009-07-03 19:08                 ` Jan Djärv
2009-07-03 19:15                   ` Eli Zaretskii
2009-07-03 19:31                     ` Leo
2009-07-03 22:32                     ` Lennart Borgman
2009-07-03 19:05               ` Eli Zaretskii
2009-07-03 19:13                 ` Jan Djärv
2009-07-03 19:08           ` Eli Zaretskii
2009-07-03 19:21             ` Jan Djärv
2009-07-03 23:42             ` Lennart Borgman
2009-07-03 16:14       ` Jan Djärv
2009-07-03 19:10         ` Eli Zaretskii
2009-07-03 19:25           ` Jan Djärv
2009-07-03 20:07             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3y6yxrsqt.fsf@fitzsim.org \
    --to=fitzsim@fitzsim.org \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).