From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: Bidi reordering engine upgraded Date: Thu, 16 Oct 2014 07:55:53 +0400 Message-ID: <543F41C9.3000507@yandex.ru> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1413431837 23634 80.91.229.3 (16 Oct 2014 03:57:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Oct 2014 03:57:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 16 05:57:10 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 1XecBa-0005q5-Ij for ged-emacs-devel@m.gmane.org; Thu, 16 Oct 2014 05:57:10 +0200 Original-Received: from localhost ([::1]:47927 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XecBa-0003qC-35 for ged-emacs-devel@m.gmane.org; Wed, 15 Oct 2014 23:57:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XecAd-00033l-K8 for emacs-devel@gnu.org; Wed, 15 Oct 2014 23:56:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XecAW-0001uB-J9 for emacs-devel@gnu.org; Wed, 15 Oct 2014 23:56:11 -0400 Original-Received: from forward2l.mail.yandex.net ([84.201.143.145]:55287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XecAO-0001tG-TC; Wed, 15 Oct 2014 23:55:57 -0400 Original-Received: from smtp19.mail.yandex.net (smtp19.mail.yandex.net [95.108.252.19]) by forward2l.mail.yandex.net (Yandex) with ESMTP id A13391AC0BEB; Thu, 16 Oct 2014 07:55:54 +0400 (MSK) Original-Received: from smtp19.mail.yandex.net (localhost [127.0.0.1]) by smtp19.mail.yandex.net (Yandex) with ESMTP id 3D266BE0437; Thu, 16 Oct 2014 07:55:54 +0400 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp19.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IlCkD7NHW1-trSmTVk1; Thu, 16 Oct 2014 07:55:53 +0400 (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (Client certificate not present) X-Yandex-Uniq: b0b8c34f-d461-49df-a5a5-ebdf42e14d9f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1413431753; bh=fU73MhUXpuZ3c58c/vyln9DQT9e7IS6SHnug9wbpxTQ=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=e5g0wRHie/KplLqvopss3eeBNNW6f5pIOsPkQuou6GHWDPcK7x2TCuwz9gRuh+gww vLKurhwjcqd8/cZdN9/pHGhwfYVCcYCQLkuNObuJL4qJO7VIZVMUO33PQj+SAQvIz0 qApXCss5MfCWRej2sQsLKEPapk3ZV1DZqBmjOYcQ= Authentication-Results: smtp19.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 In-Reply-To: <83y4sh43zq.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 84.201.143.145 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:175440 Archived-At: On 10/15/2014 09:50 PM, Eli Zaretskii wrote: > So once again, I need to ask you to step through x_draw_hollow_cursor, > and see what goes wrong there in this case. 7950 x_draw_hollow_cursor (struct window *w, struct glyph_row *row) 7951 { 7952 struct frame *f = XFRAME (WINDOW_FRAME (w)); 7953 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); 7954 Display *dpy = FRAME_X_DISPLAY (f); 7955 int x, y, wd, h; 7956 XGCValues xgcv; 7957 struct glyph *cursor_glyph; 7958 GC gc; 7959 7960 /* Get the glyph the cursor is on. If we can't tell because 7961 the current matrix is invalid or such, give up. */ 1 7962 cursor_glyph = get_phys_cursor_glyph (w); 7963 if (cursor_glyph == NULL) 7964 return; 7965 7966 /* Compute frame-relative coordinates for phys cursor. */ 7967 get_phys_cursor_geometry (w, row, cursor_glyph, &x, &y, &h); 2 7968 wd = w->phys_cursor_width; 7969 7970 /* The foreground of cursor_gc is typically the same as the normal 7971 background color, which can cause the cursor box to be invisible. */ 7972 xgcv.foreground = f->output_data.x->cursor_pixel; 7973 if (dpyinfo->scratch_cursor_gc) 7974 XChangeGC (dpy, dpyinfo->scratch_cursor_gc, GCForeground, &xgcv); 7975 else 7976 dpyinfo->scratch_cursor_gc = XCreateGC (dpy, FRAME_X_WINDOW (f), 7977 GCForeground, &xgcv); 7978 gc = dpyinfo->scratch_cursor_gc; 7979 7980 /* When on R2L character, show cursor at the right edge of the 7981 glyph, unless the cursor box is as wide as the glyph or wider 7982 (the latter happens when x-stretch-cursor is non-nil). */ 7983 if ((cursor_glyph->resolved_level & 1) != 0 7984 && cursor_glyph->pixel_width > w->phys_cursor_width) 7985 { 7986 x += cursor_glyph->pixel_width - w->phys_cursor_width; 3 7987 wd -= 1; 7988 } 7989 /* Set clipping, draw the rectangle, and reset clipping again. */ 7990 x_clip_to_row (w, row, TEXT_AREA, gc); 4 7991 XDrawRectangle (dpy, FRAME_X_WINDOW (f), gc, x, y, wd, h - 1); 7992 XSetClipMask (dpy, gc, None); 7993 } At 1), cursor_glyph is GLYPHLESS_GLYPH with pixel_width 1; at 2), wd is 0; at 3), wd is -1; at 4), there is an integer overflow because XDrawRectangle accepts width and height as unsigned. Dmitry