GNOME Bugzilla – Bug 789625
pango1.40.13 breaks Nautilus ability to wrap long filenames
Last modified: 2017-11-16 00:49:30 UTC
after recent upgrade of pango to version 1.40.13 if you have a very long file name (without NO space in the filename itself) Nautilus is no more able to wrap correctly the filename and show the file name in one single line. This cause some trouble in the iconview... I'm using Nautilus 3.26.0 (https://www.archlinux.org/packages/extra/x86_64/nautilus/) on Archlinux but it seems that this issue happens also with all other pango based file managers (e.g. thunar, caja and so on...) Downgrading pango to ver. 1.40.12 solve the issue and the long filename is wrapped correctly ... I found a couple of links with some archlinux users comments about this issue and some screenshot: - https://bbs.archlinux.org/viewtopic.php?id=231332 - https://www.reddit.com/r/archlinux/comments/79byox/pango_broke_my_thunar/ regards Andrea
This was introduced by commit c4619480e536e393e2d4a8e26a6ceb5af1fe80e3. The old logic relied on break_op == BREAK_PROHIBITED to know when not to wrap characters. This was ok because line break was assumed to be prohibited unless explicitly allowed (break_op=BREAK_PROHIBITED was set only in the cases we don't want to wrap characters either). But with the new logic, due to rule LB31, break is assumed to be allowed unless explicitly prohibited. As such, break_op=BREAK_PROHIBITED is explicitly set also in the middle of words, where we would want to break if wrapping characters.
Created attachment 362597 [details] [review] Fix is_char_break issue in pango_default_break function For most cases, the is_char_break variable should be TRUE.
Thanks for the investigation! I wrote a draft patch without test, please try it. Sorry, I haven't setup the testing environment yet.
Created attachment 362598 [details] [review] Fix is_char_break issue in pango_default_break function For most cases, the is_char_break variable should be TRUE.
Hey Peng, I've compiled pango locally with your patch and tested it against Nautilus 3.26.0 and it has indeed fixed the character wrapping, Nautilus is now rendering in a grid again.
Review of attachment 362598 [details] [review]: Thanks, this fixes the bug. However these comment lines are outdated now: /* Unicode doesn't specify char wrap; we wrap around all chars * except where a line break is prohibited, which means we * effectively break everywhere except inside runs of spaces. */ I think it is a good idea to rewrite the comment in the same patch.
Created attachment 362717 [details] [review] Fix is_char_break issue in pango_default_break function For most cases, the is_char_break variable should be TRUE.
Thanks for the comments! Okay, I updated the comment in the patch.
Review of attachment 362717 [details] [review]: looks good to me. As always, adding a testcase would be fantastic, while we are at it.
Created attachment 362877 [details] [review] Add char break test cases Add char break test cases for the is_char_break variable, and fixup_broken_linebreaktest is not used any more.
Okay, I just copied some line break tests, and changed the expected results.
For the record, the proposed patch also fixes line/word break problem for Thai, as reported & tested here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=880674 Thanks for the patch!
BTW, should I change the test case from: do_test (const gchar *filename, AttrBits bits, gboolean fixup_broken_linebreaktest) to: do_test (const gchar *filename, AttrBits bits) in testboundaries_ucd.c ?
Created attachment 363128 [details] [review] Drop fixup_broken_linebreaktest variable The fixup_broken_linebreaktest variable is not needed any more.
Review of attachment 362877 [details] [review]: thanks!
Review of attachment 363128 [details] [review]: ok
Attachment 362717 [details] pushed as e8316c1 - Fix is_char_break issue in pango_default_break function Attachment 362877 [details] pushed as e6f63d7 - Add char break test cases Attachment 363128 [details] pushed as 46a6496 - Drop fixup_broken_linebreaktest variable
Thanks!