After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 315599 - PangoAttribute remains in wrong context.
PangoAttribute remains in wrong context.
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.0.x
Other Linux
: Urgent blocker
: ---
Assigned To: Behdad Esfahbod
pango-maint
Depends on:
Blocks:
 
 
Reported: 2005-09-09 03:12 UTC by Choe Hwanjin
Modified: 2006-07-10 20:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pango attribute test code (1.31 KB, text/plain)
2005-09-09 03:15 UTC, Choe Hwanjin
Details

Description Choe Hwanjin 2005-09-09 03:12:55 UTC
When I draw PangoLayout with foreground PangoAttribute, then other widget has
same foreground color. This problem often happens with input method. After
inputting some korean letters and press enter, then some strings in other parts
has changed to wrong color. Because the input method module in gtk uses
PangAttribute to exchange the style of preedit string.

So I made a test code.
"text  width attributes" is drawn with pango attributes, and the GtkLabel below
is not.
but the GtkLabel "normal text" also is in red.

cairo 0.9.2
pango 1.10.0
gtk 2.8.0
Comment 1 Choe Hwanjin 2005-09-09 03:15:50 UTC
Created attachment 52000 [details]
pango attribute test code

This code draw 2 strings, one with PangoAttribute and the other with GtkLabel.
Only the first one has PangoAttribute, but the color of second one(GtkLabel)
changes.
Comment 2 Owen Taylor 2005-10-03 02:56:27 UTC
2005-09-09  Owen Taylor  <otaylor@redhat.com>

        * pango/pangocairo-render.c (pango_cairo_show_glyph_string): unset
        all part colors, since when drawing just a glyph string,
        prepare_run() isn't called. (#315599, Choe Hwanjin)

        * pango/pango-renderer.c (pango_renderer_draw_layout_line): NULL
        out renderer->priv->line_state.
Comment 3 sangu 2006-06-17 01:38:26 UTC
this problem happens again in pango-1.13.2.

Please reopen bug 315599
-----
OS Fedora Development 200616
cairo-1.1.8-1
gtk2-2.9.3-4
Comment 4 Behdad Esfahbod 2006-06-18 19:27:43 UTC
Ah ok, my fault.  Will fix.
Comment 5 Behdad Esfahbod 2006-07-10 20:24:52 UTC
2006-07-10  Behdad Esfahbod  <behdad@gnome.org>

        Bug 315599 – PangoAttribute remains in wrong context.

        * pango/pangocairo-render.c (_pango_cairo_do_glyph_string): Rever my
        commit that removed Owen's fix from last year!



Seems like I removed all the exact lines that Owen added with this commit message:

2006-05-30  Behdad Esfahbod  <behdad@gnome.org>

        * pango/pangocairo-render.c (draw_error_underline): Fix offset to
        center the underline in requested rectangle.

        * pango/pangocairo-render.c (pango_cairo_show_glyph_string): Remove
        unncessary renderer activation and cleanup.


Oops!

Check them out:


Owen's: http://cvs.gnome.org/viewcvs/pango/pango/pangocairo-render.c?r1=1.8&r2=1.9

Mine: http://cvs.gnome.org/viewcvs/pango/pango/pangocairo-render.c?r1=1.19&r2=1.20

Put a not in the source, such that I don't remove it again ;)