GNOME Bugzilla – Bug 602284
Need a way to retrieve the preedit string in a GtkTextView.
Last modified: 2010-01-11 10:01:01 UTC
See: http://crbug.com/27547 Chromium browser's omnibox (the location bar) is built upon a GtkTextView object. When user inputs in the omnibox, the dropdown window will show the intermediate search results and suggestions. Now the problem is, there is no way to retrieve the preedit string in a GtkTextView object, so if the user uses an input method to compose a string in the omnibox, we can't show any suggestion or search result before the user committing the whole string. I think following approaches could be used to solve this problem: 1. Provide a method in GtkTextView to retrieve the preedit string. 2. Manipulate the preedit string as normal text with special predefined mark in the buffer, similar than the selection. So that the preedit string can be retrieved by the mark.
Created attachment 150831 [details] [review] Implement "preedit-changed" in GtkEntry and GtkTextView I'm facing the same limitation in Midori, except it's a GtkEntry. An intuitive solution might be to emit a "preedit-changed" signal which passes the current preedit string.
Comment on attachment 150831 [details] [review] Implement "preedit-changed" in GtkEntry and GtkTextView Looks like an ok addition, even though I have a hard time convincing myself that triggering completion popups based on incomplete preedit text is the right thing to do.
I personally have a German keyboard where I expect completion to be instant because I sometimes don't know exactly what I need to choose. If I type Japanese, it has to go through SCIM. And I still expect to see completion as I type to be useful. The use case is exactly the same, mind hitting Ctrl+Space in-between.
Pushed to master.