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 789625 - pango1.40.13 breaks Nautilus ability to wrap long filenames
pango1.40.13 breaks Nautilus ability to wrap long filenames
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.40.x
Other Linux
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks: 788115
 
 
Reported: 2017-10-29 17:17 UTC by Andrea Antolini
Modified: 2017-11-16 00:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix is_char_break issue in pango_default_break function (740 bytes, patch)
2017-10-31 05:10 UTC, Peng Wu
none Details | Review
Fix is_char_break issue in pango_default_break function (1.14 KB, patch)
2017-10-31 05:59 UTC, Peng Wu
none Details | Review
Fix is_char_break issue in pango_default_break function (1.36 KB, patch)
2017-11-01 05:36 UTC, Peng Wu
committed Details | Review
Add char break test cases (2.88 KB, patch)
2017-11-03 08:19 UTC, Peng Wu
committed Details | Review
Drop fixup_broken_linebreaktest variable (2.60 KB, patch)
2017-11-07 05:59 UTC, Peng Wu
committed Details | Review

Description Andrea Antolini 2017-10-29 17:17:32 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
Comment 1 António Fernandes 2017-10-29 23:22:51 UTC
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.
Comment 2 Peng Wu 2017-10-31 05:10:51 UTC
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.
Comment 3 Peng Wu 2017-10-31 05:12:51 UTC
Thanks for the investigation!

I wrote a draft patch without test, please try it.

Sorry, I haven't setup the testing environment yet.
Comment 4 Peng Wu 2017-10-31 05:59:43 UTC
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.
Comment 5 Joshua Strobl 2017-10-31 07:17:49 UTC
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.
Comment 6 António Fernandes 2017-10-31 16:32:54 UTC
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.
Comment 7 Peng Wu 2017-11-01 05:36:51 UTC
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.
Comment 8 Peng Wu 2017-11-01 05:38:46 UTC
Thanks for the comments!

Okay, I updated the comment in the patch.
Comment 9 Matthias Clasen 2017-11-01 13:52:12 UTC
Review of attachment 362717 [details] [review]:

looks good to me. As always, adding a testcase would be fantastic, while we are at it.
Comment 10 Peng Wu 2017-11-03 08:19:19 UTC
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.
Comment 11 Peng Wu 2017-11-03 08:24:44 UTC
Okay, I just copied some line break tests, and changed the expected results.
Comment 12 Theppitak Karoonboonyanan 2017-11-06 02:37:05 UTC
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!
Comment 13 Peng Wu 2017-11-06 08:25:44 UTC
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 ?
Comment 14 Peng Wu 2017-11-07 05:59:10 UTC
Created attachment 363128 [details] [review]
Drop fixup_broken_linebreaktest variable

The fixup_broken_linebreaktest variable is not needed any more.
Comment 15 Matthias Clasen 2017-11-15 16:21:52 UTC
Review of attachment 362877 [details] [review]:

thanks!
Comment 16 Matthias Clasen 2017-11-15 16:22:02 UTC
Review of attachment 362877 [details] [review]:

thanks!
Comment 17 Matthias Clasen 2017-11-15 16:22:20 UTC
Review of attachment 363128 [details] [review]:

ok
Comment 18 Michael Catanzaro 2017-11-15 16:28:14 UTC
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
Comment 19 Peng Wu 2017-11-16 00:49:30 UTC
Thanks!