From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: About x_draw_xwidget_glyph_string Date: Tue, 12 Apr 2016 22:46:58 +0200 Message-ID: References: <83oac93bnr.fsf@gnu.org> <83shyvi64r.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1460494075 14712 80.91.229.3 (12 Apr 2016 20:47:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Apr 2016 20:47:55 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 12 22:47:38 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 1aq5Dj-0002NM-K1 for ged-emacs-devel@m.gmane.org; Tue, 12 Apr 2016 22:47:35 +0200 Original-Received: from localhost ([::1]:57296 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aq5Di-0001PJ-WB for ged-emacs-devel@m.gmane.org; Tue, 12 Apr 2016 16:47:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46816) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aq5De-0001MA-Oy for emacs-devel@gnu.org; Tue, 12 Apr 2016 16:47:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aq5Dd-0000F0-K8 for emacs-devel@gnu.org; Tue, 12 Apr 2016 16:47:30 -0400 Original-Received: from mx1.bahnhof.se ([213.80.101.11]:50514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aq5DZ-0000EA-KR; Tue, 12 Apr 2016 16:47:25 -0400 Original-Received: from localhost (mf.bahnhof.se [213.80.101.20]) by mx1-reinject (Postfix) with ESMTP id 8A599432FD; Tue, 12 Apr 2016 22:47:19 +0200 (CEST) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MF2) Original-Received: from mf2.bahnhof.se ([127.0.0.1]) by localhost (mf2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w9w0HPuYn9Ob; Tue, 12 Apr 2016 22:47:11 +0200 (CEST) Original-Received: from mta.verona.se (h-235-62.a149.priv.bahnhof.se [85.24.235.62]) by mf2.bahnhof.se (Postfix) with ESMTP id D9F5E9402B0; Tue, 12 Apr 2016 22:47:09 +0200 (CEST) Original-Received: from localhost (unknown [127.0.0.1]) by mta.verona.se (Postfix) with ESMTP id 73C184EF499; Tue, 12 Apr 2016 20:47:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at verona.se Original-Received: from mta.verona.se ([127.0.0.1]) by localhost (exodia.verona.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tSHimDdrUGti; Tue, 12 Apr 2016 22:46:58 +0200 (CEST) Original-Received: from exodia.verona.se (www.verona.se [192.168.200.15]) by mta.verona.se (Postfix) with ESMTP id 853044EF494; Tue, 12 Apr 2016 22:46:58 +0200 (CEST) In-Reply-To: (YAMAMOTO Mitsuharu's message of "Mon, 11 Apr 2016 09:04:45 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 213.80.101.11 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:202868 Archived-At: YAMAMOTO Mitsuharu writes: >>>>>> On Sun, 10 Apr 2016 17:29:26 +0900, YAMAMOTO Mitsuharu 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); > > Oops, I meant "gtk_widget_set_size_request (xv->widgetwindow, > clip_right - clip_left, clip_bottom - clip_top);" for the last hunk. > Could you double check if this matches your intended meaning of clip_* > variables? Adding some comments to the corresponding members in > src/xwidget.h would be nice. At the moment I'm a bit confused myself. But to recap, the basic idea is, as you already noticed, to find out if the widget needs to be clipped against the edge of an emacs object. The clip values are compared to the ones from the last run in order to minimize flicker. > Also, could you also take a look at the other issue of > "xwidget-view-list gets longer and longer" I mentioned in the original > message? Yes I will attempt to do so. > > YAMAMOTO Mitsuharu > mituharu@math.s.chiba-u.ac.jp -- Joakim Verona