From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Bidi reordering engine upgraded Date: Fri, 17 Oct 2014 21:45:47 +0300 Message-ID: <83mw8u1qn8.fsf@gnu.org> References: <834mv55quj.fsf@gnu.org> <543E9122.6070605@yandex.ru> <8338ap5o7l.fsf@gnu.org> <543E9A1C.2010904@yandex.ru> <831tq95m6x.fsf@gnu.org> <83zjcx450f.fsf@gnu.org> <83y4sh43zq.fsf@gnu.org> <543F41C9.3000507@yandex.ru> <83oatc4gz3.fsf@gnu.org> <1D1BD06B-BCE5-44A0-8F9D-4A7F0DF41504@swipnet.se> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1413571583 15601 80.91.229.3 (17 Oct 2014 18:46:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Oct 2014 18:46:23 +0000 (UTC) Cc: dmantipov@yandex.ru, emacs-devel@gnu.org To: Jan =?iso-8859-1?Q?Dj=E4rv?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 17 20:46:16 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XfCXX-0003xf-TU for ged-emacs-devel@m.gmane.org; Fri, 17 Oct 2014 20:46:16 +0200 Original-Received: from localhost ([::1]:34189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfCXX-0001gW-Ia for ged-emacs-devel@m.gmane.org; Fri, 17 Oct 2014 14:46:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfCXQ-0001gR-JE for emacs-devel@gnu.org; Fri, 17 Oct 2014 14:46:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XfCXK-0000Aa-KC for emacs-devel@gnu.org; Fri, 17 Oct 2014 14:46:08 -0400 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:44751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfCXK-0000AO-7i for emacs-devel@gnu.org; Fri, 17 Oct 2014 14:46:02 -0400 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NDL00400Q4BR900@mtaout25.012.net.il> for emacs-devel@gnu.org; Fri, 17 Oct 2014 21:41:18 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NDL001FYQKU9540@mtaout25.012.net.il>; Fri, 17 Oct 2014 21:41:18 +0300 (IDT) In-reply-to: <1D1BD06B-BCE5-44A0-8F9D-4A7F0DF41504@swipnet.se> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:175527 Archived-At: > From: Jan Dj=E4rv > Date: Fri, 17 Oct 2014 19:45:34 +0200 > Cc: Dmitry Antipov , > emacs-devel@gnu.org >=20 > > =3D=3D=3D modified file 'src/xdisp.c' > > --- src/xdisp.c=092014-10-14 18:10:37 +0000 > > +++ src/xdisp.c=092014-10-16 07:16:49 +0000 > > @@ -2303,9 +2303,6 @@ get_phys_cursor_geometry (struct window= =20 > > rectangle as wide as the glyph, but use a canonical characte= r > > width instead. */ > > wd =3D glyph->pixel_width - 1; > > -#if defined (HAVE_NTGUI) || defined (HAVE_NS) > > - wd++; /* Why? */ > > -#endif > >=20 > > x =3D w->phys_cursor.x; > > if (x < 0) > >=20 > >=20 > > I never understood why we subtract 1 pixel from the cursor glyph'= s > > pixel_width, anyway, and w32 and ns countermanded that, as you se= e. > > Maybe we should also limit 'wd' from below, so it is at least 1. > >=20 > > Jan, can you comment on these issues and on the proposed patch, > > please? >=20 > 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, althoug= h I cannot test that). Opinions, anyone? =3D=3D=3D modified file 'src/xdisp.c' --- src/xdisp.c=092014-10-14 18:10:37 +0000 +++ src/xdisp.c=092014-10-17 18:39:20 +0000 @@ -2302,10 +2302,7 @@ get_phys_cursor_geometry (struct window=20 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 =3D glyph->pixel_width - 1; -#if defined (HAVE_NTGUI) || defined (HAVE_NS) - wd++; /* Why? */ -#endif + wd =3D glyph->pixel_width; =20 x =3D w->phys_cursor.x; if (x < 0) =3D=3D=3D modified file 'src/xterm.c' --- src/xterm.c=092014-10-17 16:14:37 +0000 +++ src/xterm.c=092014-10-17 18:42:08 +0000 @@ -7965,7 +7965,7 @@ x_draw_hollow_cursor (struct window *w,=20 =20 /* Compute frame-relative coordinates for phys cursor. */ get_phys_cursor_geometry (w, row, cursor_glyph, &x, &y, &h); - wd =3D w->phys_cursor_width; + wd =3D w->phys_cursor_width - 1; =20 /* The foreground of cursor_gc is typically the same as the normal background color, which can cause the cursor box to be invisibl= e. */ @@ -7981,9 +7981,9 @@ x_draw_hollow_cursor (struct window *w,=20 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) !=3D 0 - && cursor_glyph->pixel_width > w->phys_cursor_width) + && cursor_glyph->pixel_width > wd) { - x +=3D cursor_glyph->pixel_width - w->phys_cursor_width; + x +=3D cursor_glyph->pixel_width - wd; if (wd > 0) =09wd -=3D 1; } @@ -8086,12 +8086,12 @@ x_draw_bar_cursor (struct window *w, str =09=09=09=09 &dummy_y, &dummy_h); =20 =09 if ((cursor_glyph->resolved_level & 1) !=3D 0 -=09 && cursor_glyph->pixel_width > w->phys_cursor_width) -=09 x +=3D cursor_glyph->pixel_width - w->phys_cursor_width; +=09 && cursor_glyph->pixel_width > w->phys_cursor_width - 1) +=09 x +=3D cursor_glyph->pixel_width - w->phys_cursor_width - 1; =09 XFillRectangle (dpy, window, gc, x, =09=09=09 WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y + =09=09=09=09=09=09 row->height - width), -=09=09=09 w->phys_cursor_width, width); +=09=09=09 w->phys_cursor_width - 1, width); =09} =20 XSetClipMask (dpy, gc, None);