Summary: | [PATCH] [4.4rc1 regression] cannot enter text in languages requiring commit (Japanese) using input methods through their Qt4 modules | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | JR <zorael> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | chrisburel, daisuke, daniel, ek.kato |
Priority: | HI | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Broken input in KWrite, using UIM with its Qt4 im module
Working input in KWrite, using UIM with its XIM wrapper Another patch that enable to enter text in Kate |
Description
JR
2010-01-14 00:00:06 UTC
Created attachment 39866 [details]
Broken input in KWrite, using UIM with its Qt4 im module
Created attachment 39867 [details]
Working input in KWrite, using UIM with its XIM wrapper
I have the same problem, KDE 4.4.0, Qt 4.6.1, I tried with UIM 1.5.6 and 1.5.7. As I described in uim's bugzilla (http://bugs.freedesktop.org/show_bug.cgi?id=26265#c15), the changes in kdelibs-4.4.0/kdelibs-4.4.0/kate/view/kateviewinternal.cpp from kdelibs-4.3.x causes this problem. So, in case of calling KateDocument::typeChars() in line 3781, please check whether m_imPreeditRange is still valid. Following patch will solve the problem for the event sequences like uim uses. --- kateviewinternal.cpp.orig 2009-12-31 22:29:14.000000000 +0900 +++ kateviewinternal.cpp 2010-03-07 15:36:48.073367864 +0900 @@ -3778,7 +3778,7 @@ // if the input method event is text that should be inserted, call KateDocument::typeChars() with // the text. that method will handle the input and take care of overwrite mode, etc. - if ( e->commitString().length() > 0 && doc()->typeChars( m_view, e->commitString() ) ) { + if ( e->commitString().length() > 0 && !m_imPreeditRange && doc()->typeChars( m_view, e->commitString() ) ) { e->accept(); return; } SVN commit 1101297 by dhaumann: Attempt to fix xim input methods, only in trunk for now as I don't have much knowledge about this topic. The patch looks sane, though. So if there are no further problems, we maybe should consider backporting to 4.4 branch? BUG: 222620 M +1 -1 kateviewinternal.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1101297 Thanks. Please consider porting to 4.4 branch if there are no further problems. Because if I use ibus input method instead of uim, the situation is even worse unless the patch is applied. In case of ibus, I cannot input text using preedit neither with xim module nor ibus module, confirmed on Fedora 12's kdelibs-4.4.0-9 and ibus-1.2.0.20091206-2. Although I don't know the original intention of the change in kdelibs 4.4.0, I guess calling doc()->typeChars() is targeted for the input methods like table based direct input, which don't require preedit text. For the input methods like Japanese, it uses preedit text before committing actual text, and the sequence of commit the actual text and clear and/or update of preedit text depends on the situation. We need backport to 4.4 branch, because we can't input Japanese on katepart in KDE4.4. I found that this code was committed in revision 991349. http://websvn.kde.org/?view=revision&revision=991349 But I can't understand the intention from comments. Could you confirm it in the developer team? Created attachment 41802 [details]
Another patch that enable to enter text in Kate
I made another patch that enabled to input text in Kate/Kwrite.
If this patch is used, it is possible to overwrite even with
input methods like Japanese, which use preedit text before
committing actual text.
Probably, you can input text in overwrite mode, even if you
use the input methods like table based direct input.
Please review it.
Daisuke: Ok, there is another usage of insertText in that function: if (!e->preeditString().isEmpty()) { doc()->inputMethodStart(); doc()->insertText(m_imPreeditRange->start(), e->preeditString()); doc()->inputMethodEnd(); // The preedit range gets automatically repositioned } What about typeChars here? I've committed the patch: http://gitorious.org/kate/kate/commit/d3aae57f8f0501f8f73faecb3759ab6a1a66b4b5 Mark as duplicate of bug #206455. All further discussion there, please. *** This bug has been marked as a duplicate of bug 206455 *** (In reply to comment #9) > Daisuke: Ok, there is another usage of insertText in that function: > > if (!e->preeditString().isEmpty()) { > doc()->inputMethodStart(); > doc()->insertText(m_imPreeditRange->start(), e->preeditString()); > doc()->inputMethodEnd(); > // The preedit range gets automatically repositioned > } This code inserts a text only as "preedit text". I explain these roughly: "preedit text" are characters which is converting. We input Japanese after converting characters more than once by using input method. Deciding characters as Japanese is called "commit". > What about typeChars here? This method inserts a text only as "commit text". typeChars inserts a text in consideration of overwrite mode. So my patch enable to overwrite characters even if you use input method. That makes sense. Thanks a lot for the explanation. SVN commit 1117272 by cullmann: dhaumann: Attempt to fix japanese input mode CCBUG: 206455 CCBUG: 222620 M +12 -5 kateview.cpp M +3 -3 kateview.h M +6 -9 kateviewinternal.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1117272 |