GNOME Bugzilla – Bug 101380
API to map from strong/weak cursor x to index
Last modified: 2018-05-22 12:02:01 UTC
Proper handling of the non-split cursor in GtkTextView requires a way of going from a X location to the layout index that results in the weak cursor being at that X location. See bug 73307.
pango_layout_line_x_to_index() is based on what character is clicked on, not what cursor position. So, if you have, say. logical visual =========== ========== h a t C A T h a t T A C | * | * | * | > < | * | * | < > Then clicking on the right side of the t unambiguously says (according to the current interpretation) I want to insert text after the t, and clicking on the left side of the T unambiguously says "I want to insert text after the T. In order to make this actually a sensible UI, GTK+ should (as people have requested) actually *switch* the direction of the keyboard when clicking on text in the opposite direction from the current keyboard direction. This would result in the visible cursor always ending up near where you clicked. For something like the virtual cursor in GtkTextView, what we actually want to base that off of is the *cursor* location closest to where the cursor was before not the character near to where the cursor was before. Though this sounds superficially similar to bug 111031, it's not really related.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pango/issues/6.