After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 602284 - Need a way to retrieve the preedit string in a GtkTextView.
Need a way to retrieve the preedit string in a GtkTextView.
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-11-18 09:20 UTC by James Su
Modified: 2010-01-11 10:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implement "preedit-changed" in GtkEntry and GtkTextView (3.41 KB, patch)
2010-01-05 11:19 UTC, Christian Dywan
committed Details | Review

Description James Su 2009-11-18 09:20:29 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.
Comment 1 Christian Dywan 2010-01-05 11:19:34 UTC
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 2 Matthias Clasen 2010-01-07 06:29:48 UTC
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.
Comment 3 Christian Dywan 2010-01-07 15:11:05 UTC
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.
Comment 4 Christian Dywan 2010-01-11 10:00:29 UTC
Pushed to master.