unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: cursor doesn't show through transparent images in emacs 22, unlike emacs 21
Date: Thu, 24 Aug 2006 13:31:02 +0200	[thread overview]
Message-ID: <m3fyfm4bgp.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <2cd46e7f0608220645i4c9677d3mf778b3ded10dba07@mail.gmail.com> (Ken Manheimer's message of "Tue, 22 Aug 2006 09:45:56 -0400")

"Ken Manheimer" <ken.manheimer@gmail.com> 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 <storm@cua.dk> http://www.cua.dk

  reply	other threads:[~2006-08-24 11:31 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-18 23:22 cursor doesn't show through transparent images in emacs 22, unlike emacs 21 Ken Manheimer
2006-08-18 23:33 ` Drew Adams
2006-08-19 17:49   ` Ken Manheimer
2006-08-19 23:09 ` Kim F. Storm
2006-08-20  1:49   ` Ken Manheimer
2006-08-20  5:00     ` Ken Manheimer
2006-08-20  6:42       ` David Kastrup
2006-08-20 12:05     ` Richard Stallman
2006-08-20 15:10       ` Ken Manheimer
2006-08-20 17:27         ` David Kastrup
2006-08-22  3:09         ` Richard Stallman
2006-08-22  8:03           ` David Kastrup
2006-08-22 13:45             ` Ken Manheimer
2006-08-24 11:31               ` Kim F. Storm [this message]
2006-08-24 11:49                 ` David Kastrup
2006-08-25 13:48                   ` Kim F. Storm
2006-08-24 14:20                 ` Ken Manheimer
2006-08-24 14:26                   ` Kim F. Storm
2006-08-24 15:53                     ` Ken Manheimer
2006-08-24 19:56                       ` Kim F. Storm
2006-08-24 21:41                         ` Ken Manheimer
2006-08-25 14:28                         ` Kim F. Storm
2006-08-25 15:24                           ` Ken Manheimer
2006-08-26 10:08                             ` Richard Stallman
2006-08-25 20:23                 ` Richard Stallman
2006-08-25 22:35                   ` Kim F. Storm
2006-08-26 12:22                     ` Richard Stallman
2006-08-26 21:37                       ` Kim F. Storm
2006-08-27 14:34                         ` Richard Stallman
2006-08-27 20:37                           ` Ken Manheimer
2006-08-27 21:45                             ` Kim F. Storm
2006-08-28 22:10                               ` Richard Stallman
2006-08-28 22:27                                 ` Ken Manheimer
2006-08-29 17:18                                   ` Richard Stallman
2006-08-28 22:33                                 ` Kim F. Storm
2006-08-27 20:42                           ` Juri Linkov
2006-08-27 22:24                             ` Kim F. Storm
2006-08-28 21:27                               ` Juri Linkov
2006-08-28 22:09                             ` Richard Stallman
2006-08-28 22:44                               ` Juri Linkov
2006-08-28 23:02                                 ` Kim F. Storm
2006-08-29 21:31                                   ` Ken Manheimer
2006-08-29 21:36                                     ` David Kastrup
2006-08-29 22:12                                       ` Ken Manheimer
2006-08-30 17:58                                         ` Richard Stallman
2006-08-30 18:20                                           ` Ken Manheimer
2006-08-31 18:16                                             ` Richard Stallman
2006-09-01 15:46                                               ` Ken Manheimer
2006-08-29 17:18                                 ` Richard Stallman
2006-08-29 20:27                                   ` Juri Linkov
2006-08-30  8:09                                     ` Kim F. Storm
2006-08-31  7:33                                       ` Richard Stallman
2006-08-27 22:23                           ` Kim F. Storm
2006-08-28 22:10                             ` Richard Stallman
2006-08-25 23:01                   ` Ken Manheimer
2006-08-26 12:22                     ` Richard Stallman
2006-08-22 13:19           ` Ken Manheimer
2006-08-20  9:03   ` Jason Rumney
2006-08-20  9:09     ` David Kastrup
2006-08-20 12:05   ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2006-09-02 18:08 (no subject) Richard Stallman
2006-09-03 21:30 ` cursor doesn't show through transparent images in emacs 22, unlike emacs 21 Kim F. Storm
2006-09-04 17:17   ` Richard Stallman
2006-09-04 22:42     ` Kim F. Storm
2006-09-06  8:49       ` Richard Stallman
2006-09-06  9:15         ` David Kastrup
2006-09-06 10:00           ` Kim F. Storm
2006-09-06 16:12             ` Ken Manheimer
2006-09-07  6:54           ` Richard Stallman
2006-09-07  7:47             ` David Kastrup
2006-09-09 20:45               ` Richard Stallman
2006-09-09 22:55                 ` David Kastrup
2006-09-10  0:21                 ` Kim F. Storm
2006-09-10 13:04                   ` Richard Stallman
2006-09-10 20:25                     ` Kim F. Storm
2006-09-10 23:00                       ` Robert J. Chassell
2006-09-11  5:32                         ` tomas
2006-09-11  8:08                         ` Kim F. Storm
2006-09-11  8:16                           ` David Kastrup
2006-09-11 11:56                           ` Robert J. Chassell
2006-09-11 12:51                             ` Kim F. Storm
2006-09-11 14:40                               ` Robert J. Chassell
2006-09-11 14:11                       ` Richard Stallman

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=m3fyfm4bgp.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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).