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 149886 - RTL support - panel contents order should be reversed ?
RTL support - panel contents order should be reversed ?
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: panel
unspecified
Other Linux
: High normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
: 311462 (view as bug list)
Depends on:
Blocks: Persian Hebrew
 
 
Reported: 2004-08-11 08:05 UTC by Mark McLoughlin
Modified: 2015-03-24 13:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
right flip panel applets positions when in RTL locale (1.83 KB, patch)
2006-12-12 07:42 UTC, Yair Hershkovitz
none Details | Review
right flip panel applets positions when in RTL locale (1.86 KB, patch)
2006-12-13 17:48 UTC, Yair Hershkovitz
none Details | Review
right flip panel applets positions when in RTL locale and panel orientation is horizontal (2.03 KB, patch)
2006-12-13 17:52 UTC, Yair Hershkovitz
none Details | Review
rtl locale - display applets from right to left on horizontal panels (1.88 KB, patch)
2007-01-13 21:31 UTC, Yair Hershkovitz
none Details | Review
rtl locale - display applets from right to left on horizontal panels (3.12 KB, patch)
2007-01-15 16:33 UTC, Yair Hershkovitz
none Details | Review
Packed Panel in RTL locale (21.95 KB, image/png)
2007-01-16 07:55 UTC, Hamed Malek
  Details
rtl locale - display applets from right to left on horizontal panels (3.72 KB, patch)
2007-01-16 08:04 UTC, Yair Hershkovitz
none Details | Review
rtl locale - display applets from right to left on horizontal panels (3.67 KB, patch)
2007-01-19 22:29 UTC, Yair Hershkovitz
committed Details | Review

Description Mark McLoughlin 2004-08-11 08:05:01 UTC
From Fedora:

  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=108111

  When changing Locale to Arabic, the GNOME Menu still showing on the left 
  hand side not on the right hand side as it should be.


Sounds like we should reverse the order of everything in RTL locales. Mailing
gnome-i18n for input.
Comment 1 Christian Rose 2004-08-11 19:08:04 UTC
Arafat, Gil, should the panel be reversed in RTL locales as described here?
Comment 2 Gil Osher 2004-08-11 19:26:38 UTC
Yes. There are few things that have to be reversed, but there are other that
shouldn't. I'll give some examples:
The menus and toolbars (also on the panel, I'll get to it later) should be
reversed and be displayed from right-to-left.
But there are some things that shoud stay LTR! like the icons themselves (MS is
reversing the images, it's a very big mistake...), arrow buttons (like in media
players, because than you'll get something like: >> > || < << instead of: << <
|| > >>) or english text fields (like address bars in browsers).
If I got it right, this problem is after launching GNOME first time in english,
than the panel is created ordered as LTR, but when changing to arabic or hebrew
the panel isn't re-generating and ordering the applets right-to-left.
If Gnome is first-time started in hebrew (or arabic) the panel will be generated
RTL, and everything will be fine. That's why it isn't really a bug, and I
beleive that Gnome is doing a good job when it comes to RTL support.
Comment 3 Arafat Medini 2004-08-11 20:26:02 UTC
Wanted to report this bug too ;)
I agree with Gil,  still I think the "emplacement" of every icon should be
reversed too, the pixmaps themselves shouldn't, normally arrow buttons should be
reversed too, but in the special case Gil is mentioning that does not make sense.
But take a look at RB in RTL mode and compare it to LTR and you'll understand
what I mean...

I think RTL support in gnome is not really good... I reported many many bugs and
I'm still discovering each week some new ones! So ok we've reached some point of
support that's for sure but it is not #really# good...
Comment 4 Gil Osher 2004-09-21 20:46:33 UTC
We shouldn't reverse pixmaps by the software. If, for any reason, we should use
a different pixmap, we should specify a new pixmap that compatible with RTL, So
we won't accedently reverse arrows that we shouldn't or pixmaps that contains
any text (for example, the fonts control panel icon).
Comment 5 Arafat Medini 2004-09-26 16:59:40 UTC
For "vertical pixmaps" like the volume pixmap you can simply reverse from one
side to the other, for "horizontal pixmaps" like the redo/undo pixmaps you have
to draw new icons!
Comment 6 Behdad Esfahbod 2004-09-28 01:22:09 UTC
The problem of RTL layouts need super extra care.  You may want to take a look
at my slides at http://behdad.org/download/Presentations/bidi-layouts/  (the
slides apparently don't tell the whole story, but may be helpful.)

I think before just smashing things around, we need to reach to a consensus on
how this all is supposed to be implemented.  You can't just mirror ANY icon,
since, for example, the theme used may be simply shadowed!

If I make it to GNOME Summit 3 next month, I plan to discuss this with
interested people.  There's also the bidi.info project trying to figure out
these things.  In the long term, we can all just follow their recommendation ;-).
Comment 7 Arafat Medini 2004-09-28 07:26:30 UTC
Great slides Behdad!

At Arabeyes (www.arabeyes.org) we are working on the AIG : Arabization interface
guidelines, I hope this will be ready in the near future so that we can submit
to every interested hacker/community the paper to help them in recoding to rtl
languages.
Comment 8 Vincent Untz 2005-01-03 20:55:41 UTC
Guys: I might be wrong, but I think the bug is about the placement of objects on
the panel.

E.g: suppose I have this in LTR:
-----------------------------------------------------
MenuBar  Launcher                          WindowList
-----------------------------------------------------

Then (if I understand the bug correctly), in RTL, we should have:
-----------------------------------------------------
WindowList                          Launcher  MenuBar
-----------------------------------------------------
Comment 9 Arafat Medini 2005-01-12 02:17:26 UTC
does it use gtkhtml? it seems that the english words get aligned right to left
under rtl but the Arabic words get aligned from left to right under rtl!!! This
bug is very famous in gtkhtml...
Comment 10 Arafat Medini 2005-01-12 02:19:03 UTC
uh wrong posting excuse me, yes Vincent it should be like that!
Comment 11 Behdad Esfahbod 2005-07-23 17:40:30 UTC
BTW Arafat, that behavior is the alignment behavior of Gtk+.  See my slides,
it's in there.
Comment 12 Behdad Esfahbod 2005-07-23 17:41:33 UTC
Vincent, yes, packing from right to left is fine IMO.
Comment 13 Vincent Untz 2005-08-18 11:02:21 UTC
It's high priority for RTL users. Let's try to have this for 2.14. (Using 2.12.x
milestone for now because I don't have the 2.14 milestone yet ;-))
Comment 14 Arafat Medini 2005-08-20 11:56:09 UTC
yeah the poor rtl users #really# need this... my desktop and panel look so ugly
and mixed up under Arabic locale...
Comment 15 Behdad Esfahbod 2005-08-20 11:59:07 UTC
Arafat,

Why don't you or one of the Arabeyes guys take a look at it then?  The fix
should be as small as one line of change I guess.
Comment 16 Arafat Medini 2005-08-20 14:19:29 UTC
I'm not a hacker, sure if I was I would take immediately care of it...
I'll ask some Arabeyes ppl about it!
Comment 17 Roozbeh Pournader 2005-08-20 18:35:53 UTC
Hamed was talking to me about this today. CC-ing him.
Comment 18 Hamed Malek 2005-08-21 13:09:15 UTC
I took a look at the gnome-panel code, there is a gconf key named
panel_right_stick that interpret the position of objects relative to the right
(or bottom if vertical) edge of the panel. It's originally specified from the
left. What we need is to reverse its value when we are in RTL locales. It can be
done in two ways:
1. changing the code (applet.c I guess) to set the object position based on the
locale. Seems not difficult.
2. Adding a script similar to what we have in gnome-panel SRPM that change the
panel_right_stick value in RTL locales. It can be a xslt file affecting on
schemas files. This is a simple job too. I've tested this in my own machine by
changing all panel_right_stick values below the apps/panel node:

$ gconftool-2 --dump /apps/panel > temp1.entries
$ correcting the temp.entries using xslt or a simple script.
$ gconftool-2 --direct --config-source
xml:readwrite:/etc/gconf/gconf.xml.defaults --load temp.entries
Comment 19 Behdad Esfahbod 2005-08-24 23:15:29 UTC
Thanks Hamed,

I believe we need the approach numbered 1, not 2.  All calcuations etc are
intact, only draw the applets at a different position...
Comment 20 Vincent Untz 2005-09-16 16:48:04 UTC
*** Bug 311462 has been marked as a duplicate of this bug. ***
Comment 21 Vincent Untz 2006-01-24 19:29:34 UTC
Mass changing: milestone 2.12.x => milestone 2.14.x
Comment 22 yanivabir 2006-10-01 06:29:26 UTC
This is still an issue with 2.16.0. I run Ubuntu Edgy with Hebrew Locale and still experience the problem - this is a major consistency issue for the Hebrew user - and since the panel is one of the first things you see, it could deter the newbie from using GNOME.

This bug is confirmed and marked as medium importance in Ubuntu: https://launchpad.net/distros/ubuntu/+source/gnome-panel/+bug/49898.
Comment 23 Yair Hershkovitz 2006-11-26 12:38:42 UTC
I believe that a similiar code that changes the position of the applet object as the panel_right_stick should be added.

We should not use or alter panel_right_stick itself, but add more code that change the position based on the RTL property. This way if panel_right_stick is set, then in RTL mode the applet would be positioned to the left.

Open question: Should this logic be applied to horzinal panels?

However, this change won't fix all issuses with RTL panel. For example, look at the windows list applet. This applet does not support LTR. in LTR, windows are still added to the right of the the seperator (they should be added to the left), and the windows are hardly visible since the applet miscalculates its available size on the panel.

The gnome-panel bug should be solved together with bidi bugs on gnome-applets.
Comment 24 Yair Hershkovitz 2006-11-26 13:35:42 UTC
Oops, i was wrong about the location of windows in the windows applet. But miscalculating available panel size is still in tact.
Comment 25 Yair Hershkovitz 2006-12-12 07:42:27 UTC
Created attachment 78188 [details] [review]
right flip panel applets positions when in RTL locale

This patch will right flip the applets position when running in an RTL locale.
I've tested both packed and normal modes. The flip is done for both vertical/horzinal panels.
Comment 26 Yair Hershkovitz 2006-12-12 12:45:16 UTC
btw, if for some reason (which i can't think of myself) some rtl group does not wish this behavior, it is possible to add a message to the translation file to control it.
Comment 27 Farzaneh Sarafraz 2006-12-13 13:55:17 UTC
It might be better to deal with this in another bug, but the flipping is not desired in vertical panels.
Comment 28 Yair Hershkovitz 2006-12-13 17:48:55 UTC
Created attachment 78303 [details] [review]
right flip panel applets positions when in RTL locale

right flip panel applets positions when in RTL locale (better coded then previous patch)
Comment 29 Yair Hershkovitz 2006-12-13 17:52:52 UTC
Created attachment 78304 [details] [review]
right flip panel applets positions when in RTL locale and panel orientation is horizontal

This patch only flip positions for horizontal panels
Comment 30 Behdad Esfahbod 2006-12-13 19:15:34 UTC
The patch doesn't seem to do anything for me.
Comment 31 Yair Hershkovitz 2006-12-14 08:37:53 UTC
I've tested the latest patch (78304) and it works perfectly for me.
Can someone else try it too?
Comment 32 Yair Hershkovitz 2006-12-14 09:20:43 UTC
The horizontal only patch is troublesome. The applet positions are determined when the panel loads the applets. When changing the panel oriention from hotizontal to vertical (e.g Top to Left), the applets positions are not flipped back (this seems the right behavior). And now, if you log out and back in, the applets positions are flipped. So the panel looks different before and after the re-login.

A possible solution to this is to recalculate the applets positions when changing the panel orientation.

However, i think that for the sake of the panel look consistency, changing orientation should look similiar for both rtl and ltr locales. Therefor, i believe is better to right flip applets positions for both horizontal and vertical panels.
Comment 33 Yair Hershkovitz 2006-12-18 16:02:54 UTC
Both current patches (78303 78304) are not good enough. the calculation used (rtl_pos = panel_size - pos) is not correct.

For example:

|YYY                                                        XXX|

would be converted to:

|   XXX                                                     YYY|

A better position calculation could be: rtl_pos = panel_size - pos - applet_size;
but, i don't think that when doing this calculation the applet_size is known.
moreover, this means that the applets positions must be updated if the applet size is changed.

An even better solution is to not modify the position field in the applet, and calculate the rtl position before setting the applet position in the panel GtkFixed container, and giving the GtkFixed container the rtl position.
still, the applet size must be taken into consideration when calculating the rtl position. 

Figuring the applet size may continue to be an issue. (No, i'm not a gtk expert).
Maybe there is a need for a GtkRtlFixed container where the widgets positions are fixed with the exeption of mirroring the container when in rtl direction?
Comment 34 Djihed Afifi 2006-12-31 12:56:39 UTC
I was about to report this bug until I found this one. This is really a serious issue and a stopper for newbies. We're planning a big Arabic release for gnome-2-18 and we'd love to contribute whatever we can to see this resolved.

Trying the patches...
Comment 35 Djihed Afifi 2007-01-04 15:41:02 UTC
Just confirming that the patch works "good enough" for Arabic. True it doesn't take into account the size of the applet, but that's not a deal breaking problem IMO. Can we have this applied on trunk?
Comment 36 Yair Hershkovitz 2007-01-12 17:25:40 UTC
I'm almost finished working on the improved solution which will be a complete solution. it's still have a really minor issue so it'll take few more days before the patch is ready.
Comment 37 Yair Hershkovitz 2007-01-13 21:31:17 UTC
Created attachment 80200 [details] [review]
rtl locale - display applets from right to left on horizontal panels

Finally, this should end the issue.

Applets will be displayed from right to left, taking their width into consideration.

This patch also solve the issue described in comments #23 and #24.

This is HIGH importance CRITICAL bug for RTL locales, and should be included in the 2.18 release.
Comment 38 Behdad Esfahbod 2007-01-15 06:31:49 UTC
Can someone test the patch please?
Comment 39 Vincent Untz 2007-01-15 14:19:27 UTC
Behdad: dude, I can't read farsi and you can, so it's probably better that you (and not I) test it ;-)

Does the patch work on panel that are not extended? It seems to me like it wouldn't. Also, I'd need to look, but there's the right_stick setting that needs to work. Maybe it will just work, though.

I'm also not sure about the change in panel_widget_get_cursorloc(). It looks to me like it could break some stuff like drag and drop (when dropping a launcher on the panel, eg).
Comment 40 Vincent Untz 2007-01-15 14:20:06 UTC
s/extended/expanded/ in my comment :-)
Comment 41 Djihed Afifi 2007-01-15 14:48:57 UTC
Patch applied and does what's intended visually. I haven't tested in vigorously with drag and drop etc (will). But just to make sure, what are non-expanded panels? I thought all panels extend 100% to available space, horizontal or vertical.

Comment 42 Vincent Untz 2007-01-15 15:05:33 UTC
Djihed: in the panel properties dialog, it's the first checkbox.
Comment 43 Yair Hershkovitz 2007-01-15 16:06:04 UTC
The patch would work in packed panels. The code added is inside an if statement for non packed panels.
Comment 44 Djihed Afifi 2007-01-15 16:07:05 UTC
Tested dragging items, dragging new launchers from the desktop and the menu and creating new applets. Works as expected. Tried both rtl and ltr.

Expanding-retracting works as long as the applets are locked. Otherwise some misarragements may occur. However, I've seen the same behaviour from a vanilla panel.


Comment 45 Yair Hershkovitz 2007-01-15 16:09:40 UTC
But its seems that there should be more code to handle packed panels. Packed panels are not reversed for me.
Comment 46 Djihed Afifi 2007-01-15 16:27:37 UTC
You're right. When the panel is packed in rtl mode, applets get positioned in ltr order, which shouldn't happen.
Comment 47 Yair Hershkovitz 2007-01-15 16:33:39 UTC
Created attachment 80322 [details] [review]
rtl locale - display applets from right to left on horizontal panels

Same as previous patch. Also works for packed panels. 
Also fix position of new applets inserted with the "Add to panel" dialog.
Comment 48 Behdad Esfahbod 2007-01-15 17:37:10 UTC
Hamed, Roozbeh, can you guys test too?
Comment 49 Hamed Malek 2007-01-16 07:09:00 UTC
(In reply to comment #48)
> Hamed, Roozbeh, can you guys test too?
> 
I have tested it.  There are some points:
1. The latest patch does not compile for me. The last part of patch which omit the brace is unneeded.
2. There are still a problem with packed panel. When I switch to packed panel, in RTL mode, right_stick applets goes beside the menu applet in the right.
3. Hidden button moving should be reversed too. Now, when I click on right hidden key, it moves the panel to the left and vice verse.

Comment 50 Yair Hershkovitz 2007-01-16 07:38:06 UTC
Hamed,

I didn't understand the problem in 2., Can you attach a screenshot?
Comment 51 Yair Hershkovitz 2007-01-16 07:41:15 UTC
Also, IMHO, we should drop the right stick key. It never did what it was intended to do.
Comment 52 Hamed Malek 2007-01-16 07:54:39 UTC
(In reply to comment #50)
> Hamed,
> 
> I didn't understand the problem in 2., Can you attach a screenshot?
> 

Do as follow:
* Change the panel to packed mode in RTL locale.
* Logout.
* Login in RTL locale.

I will attach a screenshot.



Comment 53 Hamed Malek 2007-01-16 07:55:59 UTC
Created attachment 80361 [details]
Packed Panel in RTL locale
Comment 54 Yair Hershkovitz 2007-01-16 08:04:16 UTC
Created attachment 80365 [details] [review]
rtl locale - display applets from right to left on horizontal panels

Same as previous patch.

Fix compilation error, and fix the panel being hidden in the opposite direction of the hidden button.
Comment 55 Yair Hershkovitz 2007-01-16 08:37:59 UTC
I've just tested issue 2. in comment #49.

I've tested on a vanilla gnome-panel and in english locale, and i have the same results.

So this is a general bug in gnome-panel which does not relates to my patch.
Comment 56 Vincent Untz 2007-01-16 08:58:35 UTC
(In reply to comment #51)
> Also, IMHO, we should drop the right stick key. It never did what it was
> intended to do.

This is not an option right now, I'm sorry. (although I agree that it's the right thing to do in the long term). And note that maybe there's nothing to do for it to work in RTL environments.

One more comment about the patch: you're using spaces instead of tabs in some places.

And I still need to take some time to look at some of the changes in this patch.
Comment 57 Yair Hershkovitz 2007-01-16 09:17:47 UTC
I'd better shed some light on this patch.

The idea behind this patch is to just display the applets from right to left.
Meaning that the position 0 in the panel is the right most point in it.

The benefit of this approach is that there are almost no changes required in the panel logic.

1) Since GTK displays widgets from left to right, when passing an applet its
location in the screen, we have to subtract its width.

2) Since position 0 is the right most point. when clicking in the mouse on this point, we don't care that the mouse was clicked in (9999,0) coordinate, we care
that it was clicked in position 0 in the panel. This is why the change in
panel_widget_get_cursorloc() is required. without this change, DnD and moving applets in the panel would be broken.
Comment 58 Yair Hershkovitz 2007-01-19 22:29:13 UTC
Created attachment 80740 [details] [review]
rtl locale - display applets from right to left on horizontal panels

Use tabs instead of spaces
Comment 59 Vincent Untz 2007-02-12 22:48:05 UTC
Patch is in.

I'm not sure it fixes all RTL issues, but I can't tell. Testing it with a new user would be nice to make sure it works by default ;-)