GNOME Bugzilla – Bug 116540
GtkContainer needs to deal with RTL
Last modified: 2004-12-22 21:47:04 UTC
The focus handler in gtkcontainer.c does not deal with RTL at all. But the direction TAB_FORWARD and TAB_BACKWARD needs to be reversed in RTL mode. There may be other widgets with wrong focus handlers
I don't think GtkContainer is the right level to deal with this. A vbox shouldn't reverse its focus chain in rtl mode.
It would certainly have to me more involved than just reversing the focus chain, perhaps something like reversing the horizontal sort when direction is TAB_FORWARD/TAB_BACKWARD. (As if focus handling in gtkcontainer.c wasn't involved enough).
gtkcontainer is exactly the right place for this ... if we can make focusing work for LTR in gtkcontainer.c, we can make it work for RTL. The function where the change would be made is gtk_container_focus_sort_tab() ... you could either use g_list_sort_with_data() or have a tab_compare_ltr() and a tab_compare_rtl()
Ok, I should have looked at the code before making that comment. Here is a patch to make gtk_container_focus_sort_tab() aware of the text direction.
Created attachment 18148 [details] [review] rtl support for tab focus moving
Looks fine to me