GNOME Bugzilla – Bug 157439
The "adding to panel" is buggy when switching to an rtl environment
Last modified: 2011-02-04 16:11:01 UTC
Distribution: Fedora Core release 2 (Tettnang) Package: gnome-panel Severity: normal Version: GNOME2.7.92 unspecified Gnome-Distributor: Red Hat, Inc Synopsis: The "adding to panel" is buggy when switching to an rtl environment Bugzilla-Product: gnome-panel Bugzilla-Component: Panel Bugzilla-Version: unspecified Description: Description of Problem: When switching to an rtl environment the add to panel window becomes buggy, here is a screen: http://www.silverpen.de/panel_bug.png Steps to reproduce the problem: 1. 2. 3. Actual Results: Expected Results: How often does this happen? Additional Information: ------- Bug moved to this database by unknown@bugzilla.gnome.org 2004-11-05 07:36 ------- Unknown platform unknown. Setting to default platform "Other". Unknown milestone "unknown" in product "gnome-panel". Setting to default milestone for this product, '---' Setting to default status "UNCONFIRMED". Setting qa contact to the default for this product. This bug either had no qa contact or an invalid one.
Do you know how this can be fixed?
Which library is the application using for rendering the whole stuff inside the window? this would be very helpful.
Sorry for the spam. Confirming some bugs. Filter on "VINCENT CONFIRMS" to ignore.
Created attachment 35361 [details] Screenshot What's weird is that the latin text is correctly positionned...
Looks like a GTK+ problem. I'll attach a test case.
Created attachment 35362 [details] Test case
Created attachment 35385 [details] screenshot of testcase Hmm, to me the testcase appears to render correctly with current GTK+ head. Or is there something wrong in my screenshot ?
Vincent, can you reproduce (and screenshoot) your problems with cvs HEAD ?
*** Bug 163751 has been marked as a duplicate of this bug. ***
Matthias: I think the second line of text should always be right-aligned.
In fact, all the lines should be right-aligned. It's the case for the 'latin characters' lines. The 'arab characters' lines are at the right of the parent widget, but that's all (they're not right-aligned). Hrm... I'm not sure if I should say right-aligned or right-justified... I hope you'll understand what I mean :-)
This looks like a bug in Pango, since GtkCellRendererText doesn't really do anything special to the PangoLayout it uses.
*** Bug 316619 has been marked as a duplicate of this bug. ***
Humm, this is a bug in Pango. Pango does not support enough different alignment/direction combinations. See the slides #19, 20, and 21 here: http://behdad.org/download/Presentations/bidi-layouts/#19 In the mean time, I think the solution is to use different layouts for the heading and description, the way the text for different applets is separated currently. That should be pretty easy.
Humm, rereading what I wrote, I really meant Gtk+, not Pango. Pango support is needed too, but Gtk+ can solve it on its own.
Created attachment 60333 [details] A shorter testcase using gtk_cell_view_new_with_text
Created attachment 60334 [details] Screenshot of shorter sample
Created attachment 60656 [details] [review] patch to fix the problem 'get_layout' function of GtkCellRendererText, which renders GtkCellView, needs a 'pango_layout_set_alignment' like GtkLabel (see the 'gtk_label_ensure_layout' function).
The patch looks fine and works for me.
Can someone please see if this fixes gtk+/tests/testcellrenderertext? That one had a few alignment problems in the right-to-left case.
I will review the patch as soon as I have time for this. For the record, there's no hurry to get this committed. We are in code freeze and this will not be released until GNOME 2.14.1...
The patch doesn't work anymore as Matthias recently added an 'align' property to the textcellrenderer. So what should happen is to unset it initially and if it's not set, use the widget direction for alignment like the patch does... Note that a patch similar to the one attached is just part of the solution. You still get Arabic and English text aligned differently. To fix that we need to extend the current alignment model.
Applied to 2.8; leaving open for HEAD * gtk/gtkcellrenderertext.c (get_layout): Set the alignment of the layout according to the text direction. (#157439, Arafat Medini, patch by Hooman Mesgary)
Does this fix gtk+/test/testcellrenderertext? Also, it would be good to add more test cases to that program.
It should help with that, but as I said, this is not a complete fix.
Matthias, this only needs to be fixed in HEAD. You may want to adjust the targets appropriately.
behdad, did you ever write a patch for the fix you outlined in comment #22 ?
Created attachment 69043 [details] [review] patch? Something like this then? Looks like it fixes this particular issue. The other testcases in testcellrenderertext need some more work ... (we might have to set the layout widget to cell_area.width in the render routine if we want to pango alignments to work correctly?). Also, I introduced an align-set property here, but we can't add that to 2.10.x at this point ... We could just add the field to the priv structure for now and introduce the real align-set property in 2.12.
Yes, patch looks good. Thanks Kris.
Created attachment 69183 [details] [review] patch without property for 2.10.x
Committed the latter patch, need to add the align-set property in 2.12 once we branch.
Committed the property to HEAD. 2006-09-24 Kristian Rietveld <kris@gtk.org> * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init), (gtk_cell_renderer_text_[sg]et_property): actually add align-set property to the API (left-over patch from #157439).