GNOME Bugzilla – Bug 315374
Text view's key-press-event signal is delivered without terminating input method, resulting in truncated input
Last modified: 2005-09-06 19:34:16 UTC
DESCRIPTION: Many applications with text input use the "key-press-event" signal to catch keys with special meaning, for example to have "return" sending an instant message to the server. Input methods misbehave in this case by not terminating the input sequence before delivering the signal. As a result, the content of the text buffer is missing the last character of the input, which reappears in the buffer after the signal is processed. This is a serious problem with using GTK input methods in gaim. HOW TO REPRODUCE: Run the attached Python script. It creates a label and a text box. You can type text into the text box; when you press enter, the text is shown in the label. To reproduce the bug, switch to "Vietnamese (VIQR)" input method and type "bla" followed by enter. RESULT: "bl" shown in the label and an underlined "a" remains in the text buffer. EXPECTED RESULT: "bla" shown in the label, text buffer empty. Applications could presumably work around this by using connect_after, but this would cause characters like "enter" to insert unwanted characters into the buffer. The application uses regular connect for good reason, and it works well, except when input methods are used. This problem is not specific to VIQR, it happens with any input method when return is pressed while the most recently typed character remains underlined. It can also be reproduced with the IPA input method with the same "bla" example. This happens in GTK 2.6.8; I do not have GTK 2.8 to test whether this has been fixed.
Created attachment 51878 [details] Python script to reproduce the problem
If you connect to "activate" then you probably wont have the problem, for the particular case of "Return". Hard problem in general. *** This bug has been marked as a duplicate of 62948 ***
I don't think it's possible for gaim, which is configurable to accept either return or ctrl-return as ways of sending the message. Can a program configure what triggers the "activate" signal?