On Thu, 2004-10-21 at 22:31 +0700, Theppitak Karoonboonyanan wrote: > Hello, > > I have got a question while working with Thai IM through the GtkIMContext > API: > > What should be the "cursor_index" in reply to the "retrieve-surrounding" > signal when the some text portion is selected? > > My opinion is that returning the actual cursor position, regardless of > being the start or end of selection, is not appropriate. Rather, the > text widget should determine the start and end of selection and choose > one to return. > > Since the selection is to be replaced by next committed text from IM, > it can be treated as a "wide" cursor. Whether returning the start or > end position is more useful depends on which part of info the IM is > interested. > > For Thai IM, where significant info is to the left of cursor, the start > of selection is more useful. But some other IM's may care more for the > other side, making selection end more useful. (Is there any such IM?) > > What should be decided for this? Do we need to extend the interface to allow retrieving the actual selected range? I tend to agree that returning, say, the logical start of the selection is better than returning the actual cursor position, but I don't know if that is sufficient to get all desired behaviors. In general, the fact that the selection in GtkTextView is anchor => cursor should never be revealed to the user. See bug 153205 for a related problem. Regards, Owen
Attachment:
signature.asc
Description: This is a digitally signed message part