http://bugs.winehq.org/show_bug.cgi?id=35929
Bug ID: 35929 Summary: Delayed IM input inserts wrong text Product: Wine Version: 1.7.15 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: lilydjwg@gmail.com
Created attachment 47979 --> http://bugs.winehq.org/attachment.cgi?id=47979 A simple PyQt program to make the issue easier to reproduce
I'm using fcitx. During text input with it, when a native application's GUI hangs for a while (e.g being busy with something), text inputted meanwhile will appear and get inserted after that. Users will only notice the delay but the text is expected. But in Wine applications, in this case, text inserted will be the last one repeated a certain times.
To demostrate, I've attached a simple PyQt program which has two items: one text input entry and one button. When the button is clicked, the whole program will just hang for five seconds. The procedure is as follows:
1. install python and coresponding PyQt. You can use the following two Python: https://www.python.org/ftp/python/3.3.5/python-3.3.5.msi PyQt: http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.10.4/PyQt4-4.10.4-gp... 2. wine path/to/drive_c/Python33/python.exe ./delayedinput.py 3. focus the input entry, active the IM 4. click the button 5. before the program becomes responsive again, type any two or three Chinese characters, e.g. a space g space. These should input two different Chinese characters with Wubi or Pinyin 6. wait the program to resume, you'll see two same Chinese characters are there
You can repeat the same procedure with native Python and PyQt on Windows and Linux, and you'll get two different Chinese characters there correctly.
I use PyQt because I don't write Win32 applications, but they suffer this issue two. In fact I found this with Tencent Messager.
This happens with Wubi or Pinyin, not with keyboard IMs or Anthy. The differences are, Wubi and Pinyin use space to commit input, keyboard IMs commit on every key press, Anthy uses enter to commit.
http://bugs.winehq.org/show_bug.cgi?id=35929
lilydjwg@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fracting@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=35929
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |felixonmars@gmail.com
--- Comment #1 from Qian Hong fracting@gmail.com --- Thanks for reporting.
CC Felix: Felix, is this bug similar to the one you talked to me with gtalk in the past? Could you reproduce this one? Thanks!
http://bugs.winehq.org/show_bug.cgi?id=35929
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase
http://bugs.winehq.org/show_bug.cgi?id=35929
--- Comment #2 from Qian Hong fracting@gmail.com --- Hi lilydjwg,
Thanks for the bug report, I fail to reproduce it, could you upload a +tid,+imm debug log? Thanks!
http://bugs.winehq.org/show_bug.cgi?id=35929
--- Comment #3 from lilydjwg@gmail.com --- Created attachment 48090 --> http://bugs.winehq.org/attachment.cgi?id=48090 +tid,+imm
command:
WINEDEBUG=+tid,+imm unbuffer wine winetest/wine/drive_c/Python33/python.exe delayedinput.py &> wine.log
「工了」 typed two times, the last one is the right one to reproduce the issue (the first one is just a mistake)
http://bugs.winehq.org/show_bug.cgi?id=35929
--- Comment #4 from lilydjwg@gmail.com --- This seems to be caused by wrong sequence of calls to updateResultStr and ImmGetCompositionStringT.
http://bugs.winehq.org/show_bug.cgi?id=35929
--- Comment #5 from lilydjwg@gmail.com --- I finally see the reason.
After frozen, IME_SetResultString gets called twice, and sets a different string every time, but then ImmGetCompositionString* gets called twice to retrieve the same string that is set last time.
https://bugs.winehq.org/show_bug.cgi?id=35929
Jactry Zeng jactry92@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jactry92@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=35929
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #6 from Qian Hong fracting@gmail.com --- Confirming, now I can reproduce.
The key points to reproduce including: 1. type fast 2. type <a>, <space>, <g>, <space> Note: two <space> is needed so that two Chinese characters would be committed separately in two times, rather than committing a Chinese string with two characters together in one time.
Thanks lilydjwg for the report and test case, good catch.