GNOME Bugzilla – Bug 50768
Make the input widget's cursor Xkb keyboard layout aware
Last modified: 2011-02-04 16:09:25 UTC
The input widget's cursor should be aware of the keyboard layout we're currently using, and whether we're about to input RTL. When we're in an RTL-language keyboard layout, the cursor should have the indicator arrow pointing to the left, to reflect the input directionality. Similarily, switching to an LTR-language (e.g. English) should make the indicator arrow pointing to the right. This would also eliminate the need for the "double cursor", at places where GTK+ cannot otherwise know on what side of the string the input would continue (Hebrew will attach to the left of the existing Hebrew string, but if we'll enter an English string suddenly, it'll be added to the right of the Hebrew string -- in strong-LTR aligned BiDi of course). The prediction about where the next input would be added would be based on the current keyboard layout. Since with proper Xkb keyboard maps we can know the current group's Name, we can use this name to decide whether the current group (in multigroup maps, such as an English-Hebrew one) is for inputing an RTL language (such as Hebrew or Arabic) or an LTR language (such as English). This should require standardization of the group names used in the Xkb maps distributed with XFree86. Group names are supposed to be named after the language, not the country. And even then, "Israelian" isn't quite proper English (supposed to be "Israeli" -- or in our case, "Hebrew").
Patches for this can be found at: http://mail.gnome.org/archives/gtk-devel-list/2001-June/msg00140.html (Actually, there are some, since fixed, bugs in the GtkEnty portion, but GtkTextView should work fine.)
Fri Jun 8 12:03:07 2001 Owen Taylor <otaylor@redhat.com> * gdk/gdkkeys.[ch]: Add a direction-changed signal, and gdk_keymap_get_current_direction(). * gdk/x11/gdkevents-x11.c gdk/x11/gdkkeys-x11.c gdk/x11/gdkmain-x11.c gdk/x11/gdkprivate-x11.h: Track the current locked group, use it to set the keymap direction. * gtk/gtksettings.c: Add a new gtk-split-cursor setting to determine whether we draw a split cursor or use a jumping cursor based on the current direction. * gtk/gtkentry.c gtk/gtktextview.c gtk/gtktextlayout.[ch]: Obey the split cursor setting.