From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: cursor doesn't show through transparent images in emacs 22, unlike emacs 21 Date: Thu, 24 Aug 2006 13:31:02 +0200 Message-ID: References: <2cd46e7f0608181622w23c7d2b0h9b963deeadfd1c06@mail.gmail.com> <2cd46e7f0608191849g521593acm1f9dbc355315ffd6@mail.gmail.com> <2cd46e7f0608200810ge8885f7l7ffc88fd30a8a3eb@mail.gmail.com> <85zmdx2o5n.fsf@lola.goethe.zz> <2cd46e7f0608220645i4c9677d3mf778b3ded10dba07@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1156419167 31803 80.91.229.2 (24 Aug 2006 11:32:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 24 Aug 2006 11:32:47 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 24 13:32:45 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GGDRy-0004T5-JT for ged-emacs-devel@m.gmane.org; Thu, 24 Aug 2006 13:32:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GGDRy-0007ft-2F for ged-emacs-devel@m.gmane.org; Thu, 24 Aug 2006 07:32:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GGDRh-0007cL-Q0 for emacs-devel@gnu.org; Thu, 24 Aug 2006 07:32:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GGDRg-0007aQ-B1 for emacs-devel@gnu.org; Thu, 24 Aug 2006 07:32:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GGDRg-0007aB-84 for emacs-devel@gnu.org; Thu, 24 Aug 2006 07:32:24 -0400 Original-Received: from [195.41.46.237] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GGDZf-0006BW-S3; Thu, 24 Aug 2006 07:40:40 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepc.post.tele.dk (Postfix) with SMTP id 22AFE8A0079; Thu, 24 Aug 2006 13:32:16 +0200 (CEST) Original-To: "Ken Manheimer" In-Reply-To: <2cd46e7f0608220645i4c9677d3mf778b3ded10dba07@mail.gmail.com> (Ken Manheimer's message of "Tue, 22 Aug 2006 09:45:56 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:58800 Archived-At: "Ken Manheimer" writes: > as i think i suggested in a previous message, the solution i would > prefer would be to have some way to qualify icons so that they get a > solid cursor in their transparent areas, and the default would be to > have it inactive. eg, a qualifier for xpm, png, gif, and other > transparent-capable images, like :solid-cursor: > > `:solid-cursor-shows BOOLEAN' > When true, the cursor will appear solid through the transparent > regions of the image > when the cursor is situated on the image and the window is > active. The default is for > only the cursor border to show, whether or not the window is active. > > by having the default be off, then the disruption of oversize blinking > icons will be avoided. Below is a patch which adds a new image :cursor property where you can specify the actual type of cursor to show on the image in the selected window (that is more flexible than your suggestion, and just as easy to do). Due to limitations in what cursors can be displayed for an image (bar and hbar both gives a solid box??), it only works to set it to box, hollow, and t (which means use whatever cursor-type is in the buffer). As an additional part of the patch, it only changes the cursor from box to hollow for images which as greater than 4 times the frame's default font size i.e. small images will behave like normal glyphs with respect to the box cursor. We can use either or both methods -- WDYT ? *** xdisp.c 22 Aug 2006 23:28:12 +0200 1.1113 --- xdisp.c 24 Aug 2006 13:12:33 +0200 *************** *** 367,373 **** Lisp_Object Qimage; /* The image map types. */ ! Lisp_Object QCmap, QCpointer; Lisp_Object Qrect, Qcircle, Qpoly; /* Non-zero means print newline to stdout before next mini-buffer --- 367,373 ---- Lisp_Object Qimage; /* The image map types. */ ! Lisp_Object QCmap, QCpointer, QCcursor; Lisp_Object Qrect, Qcircle, Qpoly; /* Non-zero means print newline to stdout before next mini-buffer *************** *** 21210,21217 **** if (!w->cursor_off_p) { if (glyph != NULL && glyph->type == IMAGE_GLYPH) { ! if (cursor_type == FILLED_BOX_CURSOR) ! cursor_type = HOLLOW_BOX_CURSOR; } return cursor_type; } --- 21210,21238 ---- if (!w->cursor_off_p) { if (glyph != NULL && glyph->type == IMAGE_GLYPH) { ! struct image *img = IMAGE_FROM_ID (f, glyph->u.img_id); ! if (img != NULL && IMAGEP (img->spec)) ! { ! /* If image has a :cursor property, use that in selected window. ! If property value is `t', use current cursor_type. */ ! Lisp_Object cursor_prop; ! if ((cursor_prop = Fplist_get (XCDR (img->spec), QCcursor), ! !NILP (cursor_prop))) ! return (EQ (cursor_prop, Qt) ! ? cursor_type ! : get_specified_cursor_type (cursor_prop, width)); ! ! /* Just show border around images to avoid excessive blinking ! for "large images". */ ! if (cursor_type == FILLED_BOX_CURSOR ! && (img->width > WINDOW_FRAME_COLUMN_WIDTH (w) * 4 ! || img->height > WINDOW_FRAME_LINE_HEIGHT (w) * 4)) ! cursor_type = HOLLOW_BOX_CURSOR; ! } ! else ! /* Just show border around images to avoid excessive blinking */ ! if (cursor_type == FILLED_BOX_CURSOR) ! cursor_type = HOLLOW_BOX_CURSOR; } return cursor_type; } *************** *** 23709,23714 **** --- 23730,23737 ---- staticpro (&QCmap); QCpointer = intern (":pointer"); staticpro (&QCpointer); + QCcursor = intern (":cursor"); + staticpro (&QCcursor); Qrect = intern ("rect"); staticpro (&Qrect); Qcircle = intern ("circle"); -- Kim F. Storm http://www.cua.dk