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 157439 - The "adding to panel" is buggy when switching to an rtl environment
The "adding to panel" is buggy when switching to an rtl environment
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
unspecified
Other All
: Normal normal
: ---
Assigned To: Kristian Rietveld
gtktreeview-bugs
: 163751 316619 (view as bug list)
Depends on:
Blocks: Persian
 
 
Reported: 2004-11-05 12:43 UTC by Arafat Medini
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Screenshot (52.09 KB, image/png)
2005-01-02 18:11 UTC, Vincent Untz
  Details
Test case (1.68 KB, text/plain)
2005-01-02 18:40 UTC, Vincent Untz
  Details
screenshot of testcase (9.90 KB, image/png)
2005-01-03 13:56 UTC, Matthias Clasen
  Details
A shorter testcase using gtk_cell_view_new_with_text (580 bytes, text/plain)
2006-02-28 17:54 UTC, Hooman "Messi" Mesgary
  Details
Screenshot of shorter sample (3.89 KB, image/png)
2006-02-28 17:55 UTC, Hooman "Messi" Mesgary
  Details
patch to fix the problem (727 bytes, patch)
2006-03-04 19:37 UTC, Hooman "Messi" Mesgary
needs-work Details | Review
patch? (2.83 KB, patch)
2006-07-17 13:32 UTC, Kristian Rietveld
none Details | Review
patch without property for 2.10.x (1.47 KB, patch)
2006-07-19 16:15 UTC, Kristian Rietveld
none Details | Review

Description Arafat Medini 2004-11-05 12:36:33 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.

Comment 1 Vincent Untz 2004-11-06 22:22:46 UTC
Do you know how this can be fixed?
Comment 2 Arafat Medini 2004-11-07 09:06:09 UTC
Which library is the application using for rendering the whole stuff inside the
window? this would be very helpful.
Comment 3 Vincent Untz 2004-12-23 09:36:46 UTC
Sorry for the spam. Confirming some bugs.
 Filter on "VINCENT CONFIRMS" to ignore.
Comment 4 Vincent Untz 2005-01-02 18:11:54 UTC
Created attachment 35361 [details]
Screenshot

What's weird is that the latin text is correctly positionned...
Comment 5 Vincent Untz 2005-01-02 18:39:44 UTC
Looks like a GTK+ problem. I'll attach a test case.
Comment 6 Vincent Untz 2005-01-02 18:40:11 UTC
Created attachment 35362 [details]
Test case
Comment 7 Matthias Clasen 2005-01-03 13:56:00 UTC
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 ?
Comment 8 Matthias Clasen 2005-01-03 15:59:22 UTC
Vincent, can you reproduce (and screenshoot) your problems with cvs HEAD ?
Comment 9 Vincent Untz 2005-01-12 08:40:27 UTC
*** Bug 163751 has been marked as a duplicate of this bug. ***
Comment 10 Vincent Untz 2005-01-12 08:42:42 UTC
Matthias: I think the second line of text should always be right-aligned.
Comment 11 Vincent Untz 2005-01-12 08:46:58 UTC
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 :-)
Comment 12 Federico Mena Quintero 2005-06-15 01:27:37 UTC
This looks like a bug in Pango, since GtkCellRendererText doesn't really do
anything special to the PangoLayout it uses.
Comment 13 Vincent Untz 2005-09-18 13:01:18 UTC
*** Bug 316619 has been marked as a duplicate of this bug. ***
Comment 14 Behdad Esfahbod 2005-09-18 22:22:02 UTC
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.
Comment 15 Behdad Esfahbod 2005-09-18 22:25:24 UTC
Humm, rereading what I wrote, I really meant Gtk+, not Pango.  Pango support is
needed too, but Gtk+ can solve it on its own.
Comment 16 Hooman "Messi" Mesgary 2006-02-28 17:54:08 UTC
Created attachment 60333 [details]
A shorter testcase using gtk_cell_view_new_with_text
Comment 17 Hooman "Messi" Mesgary 2006-02-28 17:55:57 UTC
Created attachment 60334 [details]
Screenshot of shorter sample
Comment 18 Hooman "Messi" Mesgary 2006-03-04 19:37:33 UTC
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).
Comment 19 Roozbeh Pournader 2006-03-05 11:56:45 UTC
The patch looks fine and works for me.
Comment 20 Federico Mena Quintero 2006-03-06 23:47:18 UTC
Can someone please see if this fixes gtk+/tests/testcellrenderertext?  That one had a few alignment problems in the right-to-left case.
Comment 21 Behdad Esfahbod 2006-03-07 10:37:19 UTC
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...
Comment 22 Behdad Esfahbod 2006-04-05 19:02:47 UTC
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.
Comment 23 Matthias Clasen 2006-04-07 19:29:52 UTC
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)
Comment 24 Federico Mena Quintero 2006-04-07 20:02:10 UTC
Does this fix gtk+/test/testcellrenderertext?  Also, it would be good to add more test cases to that program.
Comment 25 Behdad Esfahbod 2006-04-07 20:19:43 UTC
It should help with that, but as I said, this is not a complete fix.
Comment 26 Behdad Esfahbod 2006-05-16 19:49:04 UTC
Matthias, this only needs to be fixed in HEAD.  You may want to adjust the targets appropriately.
Comment 27 Matthias Clasen 2006-06-19 22:01:57 UTC
behdad, did you ever write a patch for the fix you outlined in comment #22 ?
Comment 28 Kristian Rietveld 2006-07-17 13:32:55 UTC
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.
Comment 29 Behdad Esfahbod 2006-07-18 14:54:50 UTC
Yes, patch looks good.  Thanks Kris.
Comment 30 Kristian Rietveld 2006-07-19 16:15:24 UTC
Created attachment 69183 [details] [review]
patch without property for 2.10.x
Comment 31 Kristian Rietveld 2006-07-19 16:27:30 UTC
Committed the latter patch, need to add the align-set property in 2.12 once we branch.
Comment 32 Kristian Rietveld 2006-09-24 17:12:20 UTC
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).