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 438944 - incorrect title when using a rtl language
incorrect title when using a rtl language
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
trunk
Other Linux
: Normal normal
: 2.18.x
Assigned To: Thomas Thurman
Metacity maintainers list
Depends on:
Blocks: 443457
 
 
Reported: 2007-05-16 17:20 UTC by Sebastien Bacher
Modified: 2007-06-03 06:35 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Patch to show what titles are being set (for debugging) (408 bytes, patch)
2007-06-03 05:20 UTC, Thomas Thurman
none Details | Review
Set LTR/RTLness of paragraphs from base widget (513 bytes, patch)
2007-06-03 06:28 UTC, Thomas Thurman
committed Details | Review

Description Sebastien Bacher 2007-05-16 17:20:30 UTC
The bug has been described on https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/109723

"Binary package hint: gedit

Running Ubuntu 7.04 with the default installation of gedit:

I created a file on my desktop called
ةجةكصڑڵگڦﭟﯙﻺ (Arabic letters)
saved that name then opened it up in gedit. Gedit with the file title text moved to the left (like it should with Arabic characters) but the non arabic part of the title (the bit that says gedit and ~Desktop) is in the wrong place and slightly garbled. This only happens when the first character in the file name is aligned to the right (as with languages like Arabic and Hebrew), but not if the first letter is left aligned (like in standard English)

This also happens when file names with Hebrew, Syriac and Thaana letters are used in file names.

All characters used in finding this bug were from the Ubuntu Character Map. Screenshot of bug is attached in a comment below.
...
http://librarian.launchpad.net/7400249/Bug109723Screenshot.png
Screenshot of Bug 109723

Included : Screenshot of Bug 109723"
Comment 1 Thomas Thurman 2007-05-23 15:19:32 UTC
For me (Ubuntu 7.04) I get

   txt (~/Desktop) - gedit.ةجةكصڑڵگڦﭟﯙﻺ

I don't think that's right, either.

Doing the same for a png and opening it in GIMP gives

   png.ةجةكصڑڵگڦﭟﯙﻺ

although Nautilus displays both as ةجةكصڑڵگڦﭟﯙﻺ.whatever (and so does ls). So this probably isn't so much a gimp problem as either a gtk or a metacity problem. I'll investigate further in a bit.
Comment 2 Thomas Thurman 2007-05-23 15:24:54 UTC
er, sorry, s/a gimp problem/a gedit problem/
Comment 3 Thomas Thurman 2007-05-24 04:15:34 UTC
I added a couple of lines to metacity to print titles as they were plotted:

marnanel@ubuntu:~/proj/metacity/pristine/trunk$ src/metacity --replace
Rhybudd rheolydd ffenestri: Setting title to ةجةكصڑڵگڦﭟﯙﻺ.txt (~/Desktop) - gedit
Rhybudd rheolydd ffenestri: Setting title to ةجةكصڑڵگڦﭟﯙﻺ.png
Rhybudd rheolydd ffenestri: Setting title to Gajim
...

So the data's coming through just fine to metacity. So either it's a problem inside metacity or it's a problem in the libraries metacity uses to plot the strings: either way I'm reassigning it to metacity.
Comment 4 Thomas Thurman 2007-06-03 05:20:20 UTC
Created attachment 89267 [details] [review]
Patch to show what titles are being set (for debugging)

In case anyone else wants to know how to log window title setting...
Comment 5 Thomas Thurman 2007-06-03 06:28:19 UTC
Created attachment 89269 [details] [review]
Set LTR/RTLness of paragraphs from base widget

Aha, we have a solution. Okay, here's what's up. Pango has a concept of the "base direction" of a paragraph, which means whether it lays it out left-to-right or right-to-left. There are two ways it can figure this out, selected using pango_layout_set_auto_dir().

The default is to sniff the content, look for Hebrew or Arabic text early on, and if it finds it, to lay out the paragraph right-to-left; otherwise, to lay out the paragraph left-to-right. This is NOT what we want, and it's what we're getting.

The other possibility is to get the direction from the content, i.e. in our case, from the underlying widget. This IS what we want. The patch turns this on.

This solves the problem in an LTR locale (English). No problem was reported in an RTL locale, but of course I tested this in an RTL locale (Arabic) too, and it appeared to work as expected. (Bear in mind, however, that I don't speak Arabic or Hebrew, so if anyone who does can help us out here I'd be grateful.)

wnck also exhibits this bug, and I'll raise a bug there next.
Comment 6 Thomas Thurman 2007-06-03 06:32:51 UTC
Committed and FIXED. Bug 443457 is the libwnck bug.
Comment 7 Thomas Thurman 2007-06-03 06:35:08 UTC
(In reply to comment #5)
> The other possibility is to get the direction from the content, i.e. in our
                                                              ^
from the conteXt (the PangoContext object). Bad typo.