emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About x_draw_xwidget_glyph_string


From: joakim
Subject: Re: About x_draw_xwidget_glyph_string
Date: Tue, 12 Apr 2016 22:46:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux)

YAMAMOTO Mitsuharu <address@hidden> writes:

>>>>>> On Sun, 10 Apr 2016 17:29:26 +0900, YAMAMOTO Mitsuharu <address@hidden> 
>>>>>> 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
>>                      address@hidden
>
>> 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
>                               address@hidden

-- 
Joakim Verona



reply via email to

[Prev in Thread] Current Thread [Next in Thread]