From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: About x_draw_xwidget_glyph_string Date: Sun, 10 Apr 2016 17:29:26 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <83oac93bnr.fsf@gnu.org> <83shyvi64r.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1460276985 32097 80.91.229.3 (10 Apr 2016 08:29:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Apr 2016 08:29:45 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 10 10:29:40 2016 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 1apAkV-0001U0-Qu for ged-emacs-devel@m.gmane.org; Sun, 10 Apr 2016 10:29:39 +0200 Original-Received: from localhost ([::1]:34214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apAkV-0001R2-8p for ged-emacs-devel@m.gmane.org; Sun, 10 Apr 2016 04:29:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apAkR-0001Ni-G3 for emacs-devel@gnu.org; Sun, 10 Apr 2016 04:29:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1apAkQ-0002wG-Hw for emacs-devel@gnu.org; Sun, 10 Apr 2016 04:29:35 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:60354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apAkM-0002uh-5r; Sun, 10 Apr 2016 04:29:30 -0400 Original-Received: from fermat1.math.s.chiba-u.ac.jp (fermat [192.168.32.10]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 5F092F08F1; Sun, 10 Apr 2016 17:29:26 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 133.82.132.2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:202835 Archived-At: >>>>> On Sat, 09 Apr 2016 13:22:52 +0200, joakim@verona.se said: >> I think clip_top should use text_area_y and clip_bottom should use >> text_area_height. >> >> Other than those two issues, what other problems do you see? > Well, I saw nothing at all :) > This patch seems to work during some brief testing. C-x 2 or C-x 3 makes the display incorrect. I'm not sure if I understand the intended meaning of clip_* variables correctly, but shouldn't this part be something like below? YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp diff --git a/src/xwidget.c b/src/xwidget.c index 7e96307..0777777 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -580,20 +580,14 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) int text_area_x, text_area_y, text_area_width, text_area_height; - window_box (s->w, - ANY_AREA, - &text_area_x, - &text_area_y, - &text_area_width, - &text_area_height); - clip_right = min (xww->width, - text_area_width); - clip_left = max (0, - text_area_x); - - clip_bottom = min (xww->height, - text_area_height); - clip_top = max (0, text_area_y); + window_box (s->w, TEXT_AREA, &text_area_x, &text_area_y, + &text_area_width, &text_area_height); + clip_left = max (0, text_area_x - x); + clip_right = max (clip_left, + min (xww->width, text_area_x + text_area_width - x)); + clip_top = max (0, text_area_y - y); + clip_bottom = max (clip_top, + min (xww->height, text_area_y + text_area_height - y)); /* We are concerned with movement of the onscreen area. The area might sit still when the widget actually moves. This happens @@ -622,8 +616,7 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) || xv->clip_bottom != clip_bottom || xv->clip_top != clip_top || xv->clip_left != clip_left) { - gtk_widget_set_size_request (xv->widgetwindow, clip_right + clip_left, - clip_bottom + clip_top); + gtk_widget_set_size_request (xv->widgetwindow, clip_right, clip_bottom); gtk_fixed_move (GTK_FIXED (xv->widgetwindow), xv->widget, -clip_left, -clip_top);