From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thomas Fitzsimmons Newsgroups: gmane.emacs.devel Subject: Re: invisible mouse pointer? Date: Wed, 03 Dec 2008 10:58:02 -0800 Message-ID: References: <001701c9556c$9e613750$c2b22382@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1228331873 7462 80.91.229.12 (3 Dec 2008 19:17:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Dec 2008 19:17:53 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 03 20:18:56 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L7xFB-0004DC-SC for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 20:18:42 +0100 Original-Received: from localhost ([127.0.0.1]:33275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7xE1-0000Mf-PL for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 14:17:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L7wvR-0003Fl-2f for emacs-devel@gnu.org; Wed, 03 Dec 2008 13:58:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L7wvO-0003EK-D2 for emacs-devel@gnu.org; Wed, 03 Dec 2008 13:58:16 -0500 Original-Received: from [199.232.76.173] (port=48109 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7wvO-0003EB-At for emacs-devel@gnu.org; Wed, 03 Dec 2008 13:58:14 -0500 Original-Received: from qw-out-1920.google.com ([74.125.92.150]:25833) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7wvN-0002U6-R0 for emacs-devel@gnu.org; Wed, 03 Dec 2008 13:58:14 -0500 Original-Received: by qw-out-1920.google.com with SMTP id 4so878715qwk.24 for ; Wed, 03 Dec 2008 10:58:11 -0800 (PST) Original-Received: by 10.142.187.8 with SMTP id k8mr5519998wff.48.1228330690551; Wed, 03 Dec 2008 10:58:10 -0800 (PST) Original-Received: from autumn (c-24-23-196-54.hsd1.ca.comcast.net [24.23.196.54]) by mx.google.com with ESMTPS id 28sm392406wfg.8.2008.12.03.10.58.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Dec 2008 10:58:09 -0800 (PST) In-Reply-To: <001701c9556c$9e613750$c2b22382@us.oracle.com> (Drew Adams's message of "Wed, 3 Dec 2008 09:28:55 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Wed, 03 Dec 2008 14:17:25 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:106527 Archived-At: --=-=-= Hi Drew, "Drew Adams" 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=emacs-hide-cursor.patch 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 #include #ifndef USE_MOTIF @@ -5258,6 +5259,35 @@ /*********************************************************************** + 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; +} + + + +/*********************************************************************** 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); --=-=-=--