unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: dmantipov@yandex.ru, emacs-devel@gnu.org
Subject: Re: Bidi reordering engine upgraded
Date: Fri, 17 Oct 2014 21:45:47 +0300	[thread overview]
Message-ID: <83mw8u1qn8.fsf@gnu.org> (raw)
In-Reply-To: <1D1BD06B-BCE5-44A0-8F9D-4A7F0DF41504@swipnet.se>

> From: Jan Djärv <jan.h.d@swipnet.se>
> Date: Fri, 17 Oct 2014 19:45:34 +0200
> Cc: Dmitry Antipov <dmantipov@yandex.ru>,
>  emacs-devel@gnu.org
> 
> > === modified file 'src/xdisp.c'
> > --- src/xdisp.c	2014-10-14 18:10:37 +0000
> > +++ src/xdisp.c	2014-10-16 07:16:49 +0000
> > @@ -2303,9 +2303,6 @@ get_phys_cursor_geometry (struct window 
> >      rectangle as wide as the glyph, but use a canonical character
> >      width instead.  */
> >   wd = glyph->pixel_width - 1;
> > -#if defined (HAVE_NTGUI) || defined (HAVE_NS)
> > -  wd++; /* Why? */
> > -#endif
> > 
> >   x = w->phys_cursor.x;
> >   if (x < 0)
> > 
> > 
> > I never understood why we subtract 1 pixel from the cursor glyph's
> > pixel_width, anyway, and w32 and ns countermanded that, as you see.
> > Maybe we should also limit 'wd' from below, so it is at least 1.
> > 
> > Jan, can you comment on these issues and on the proposed patch,
> > please?
> 
> As you figured out, XDrawRectangle with width 0 and non-zero height draws a 1-pixel width line.

Thanks.  Since this appears to be specific to X, I propose the
change below for the trunk.  Does it look reasonable?

The only other question is whether we want the hollow cursor on X to
disappear when the underlying glyph is displayed as a thin space of 1
pixel.  It doesn't disappear on w32 (and possibly also on NS, although
I cannot test that).  Opinions, anyone?

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2014-10-14 18:10:37 +0000
+++ src/xdisp.c	2014-10-17 18:39:20 +0000
@@ -2302,10 +2302,7 @@ get_phys_cursor_geometry (struct window 
      glyph, and `x-stretch-block-cursor' is nil, don't draw a
      rectangle as wide as the glyph, but use a canonical character
      width instead.  */
-  wd = glyph->pixel_width - 1;
-#if defined (HAVE_NTGUI) || defined (HAVE_NS)
-  wd++; /* Why? */
-#endif
+  wd = glyph->pixel_width;
 
   x = w->phys_cursor.x;
   if (x < 0)

=== modified file 'src/xterm.c'
--- src/xterm.c	2014-10-17 16:14:37 +0000
+++ src/xterm.c	2014-10-17 18:42:08 +0000
@@ -7965,7 +7965,7 @@ x_draw_hollow_cursor (struct window *w, 
 
   /* Compute frame-relative coordinates for phys cursor.  */
   get_phys_cursor_geometry (w, row, cursor_glyph, &x, &y, &h);
-  wd = w->phys_cursor_width;
+  wd = w->phys_cursor_width - 1;
 
   /* The foreground of cursor_gc is typically the same as the normal
      background color, which can cause the cursor box to be invisible.  */
@@ -7981,9 +7981,9 @@ x_draw_hollow_cursor (struct window *w, 
      glyph, unless the cursor box is as wide as the glyph or wider
      (the latter happens when x-stretch-cursor is non-nil).  */
   if ((cursor_glyph->resolved_level & 1) != 0
-      && cursor_glyph->pixel_width > w->phys_cursor_width)
+      && cursor_glyph->pixel_width > wd)
     {
-      x += cursor_glyph->pixel_width - w->phys_cursor_width;
+      x += cursor_glyph->pixel_width - wd;
       if (wd > 0)
 	wd -= 1;
     }
@@ -8086,12 +8086,12 @@ x_draw_bar_cursor (struct window *w, str
 				    &dummy_y, &dummy_h);
 
 	  if ((cursor_glyph->resolved_level & 1) != 0
-	      && cursor_glyph->pixel_width > w->phys_cursor_width)
-	    x += cursor_glyph->pixel_width - w->phys_cursor_width;
+	      && cursor_glyph->pixel_width > w->phys_cursor_width - 1)
+	    x += cursor_glyph->pixel_width - w->phys_cursor_width - 1;
 	  XFillRectangle (dpy, window, gc, x,
 			  WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y +
 						   row->height - width),
-			  w->phys_cursor_width, width);
+			  w->phys_cursor_width - 1, width);
 	}
 
       XSetClipMask (dpy, gc, None);





  reply	other threads:[~2014-10-17 18:45 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15 14:51 Bidi reordering engine upgraded Eli Zaretskii
2014-10-15 15:22 ` Dmitry Antipov
2014-10-15 15:47   ` Eli Zaretskii
2014-10-15 16:00     ` Dmitry Antipov
2014-10-15 16:31       ` Eli Zaretskii
2014-10-15 17:28         ` Eli Zaretskii
2014-10-15 17:50           ` Eli Zaretskii
2014-10-16  3:55             ` Dmitry Antipov
2014-10-16  7:21               ` Eli Zaretskii
2014-10-16  9:42                 ` Thien-Thi Nguyen
2014-10-16 10:15                   ` Eli Zaretskii
2014-10-16 13:27                     ` Thien-Thi Nguyen
2014-10-16 13:51                       ` Eli Zaretskii
2014-10-17  5:42                         ` Thien-Thi Nguyen
2014-10-17  6:16                           ` Eli Zaretskii
2014-10-17  7:50                             ` Thien-Thi Nguyen
2014-10-17  8:25                               ` Eli Zaretskii
2014-10-17 10:27                                 ` Thien-Thi Nguyen
2014-10-17 10:31                                   ` Eli Zaretskii
2014-10-16  9:51                 ` Dmitry Antipov
2014-10-16 10:20                   ` Eli Zaretskii
2014-10-16 11:28                   ` Eli Zaretskii
2014-10-17  6:46                 ` Eli Zaretskii
2014-10-17 17:45                 ` Jan Djärv
2014-10-17 18:45                   ` Eli Zaretskii [this message]
2014-10-17 19:32                     ` Stefan Monnier
2014-10-18 12:34                     ` Jan Djärv
2014-10-18 12:54                       ` Eli Zaretskii
2014-10-18 13:13                         ` Eli Zaretskii
2014-10-19 11:45                           ` Jan Djärv
2014-10-19 13:19                             ` Eli Zaretskii
2014-10-19 11:49                           ` Jan Djärv
2014-10-19 13:20                             ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2014-10-17 11:12 grischka
2014-10-17 11:42 ` martin rudalics
2014-10-17 11:47   ` David Kastrup
2014-10-17 13:21   ` grischka
2014-10-17 13:30     ` 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=83mw8u1qn8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=jan.h.d@swipnet.se \
    /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).