GNOME Bugzilla – Bug 624917
label: Draw all text using gtk_paint_layout()
Last modified: 2018-05-22 12:56:09 UTC
Previously, selected areas were overdrawn gdk_draw_layout(). Now we insert the proper Pango markup to modify foreground and background colors of the selection or active anchors. This way, we can use gtk_paint_layout() unconditionally.
Created attachment 166273 [details] [review] label: Draw all text using gtk_paint_layout()
This patch is fallout from my rendering-cleanup branch that I'd like to a) get merged anyway, because it's useful (it fixes a FIXME) b) have someone review it who knows a bit more about GtkLabel than me.
Created attachment 166274 [details] [review] patch against master Whoops, the first patch is against my branch which some changes already. This one applies to git master.
Looks reasonable in general. Why do you need to update the attributes in focus-out ?
Turns out that patch is broken. Talking to Behdad and Owen presented the subtle issues with this patch: Create a label with the text "fi" and try selecting only one letter: It won't work. That's due "fi" being a single glyph (is that the correct term?) and Pango only changing colors at boundaries. This is why this whole patch won't work and the text needs to be rendered clipped for the selection: We need partial glyph support.
Hrm, I guess with that, I can reassign to Pango. At least Behdad said he had an idea on how to fix color attributes to work on partial glyphs.
I have an idea of how to fix it, but to do it correctly is very complex. and I mean VERY complex.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pango/issues/177.